Sha256: ba2e223e7fe4c01816e2d49833b184fc1548f61c1e3225197934e8ed62f2134f
Contents?: true
Size: 1.23 KB
Versions: 135
Compression:
Stored size: 1.23 KB
Contents
#include <string> #if !defined (STLPORT) || !defined (_STLP_USE_NO_IOSTREAMS) # include <sstream> # include "cppunit/cppunit_proxy.h" # if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES) using namespace std; # endif // // TestCase class // class IOStreamTest : public CPPUNIT_NS::TestCase { CPPUNIT_TEST_SUITE(IOStreamTest); CPPUNIT_TEST(manipulators); CPPUNIT_TEST_SUITE_END(); private: void manipulators(); }; CPPUNIT_TEST_SUITE_REGISTRATION(IOStreamTest); // // tests implementation // void IOStreamTest::manipulators() { { istringstream istr; istr.str("bar"); istr >> ws; CPPUNIT_ASSERT( istr.good() ); string foo; istr >> foo; CPPUNIT_ASSERT( istr.eof() ); CPPUNIT_ASSERT( !istr.fail() ); CPPUNIT_ASSERT( foo == "bar" ); istr >> ws; CPPUNIT_ASSERT( istr.eof() ); CPPUNIT_ASSERT( !istr.fail() ); istr.clear(); } { istringstream istr; istr.str(" bar "); istr >> ws; CPPUNIT_ASSERT( istr.good() ); string foo; istr >> foo; CPPUNIT_ASSERT( !istr.eof() ); CPPUNIT_ASSERT( !istr.fail() ); CPPUNIT_ASSERT( foo == "bar" ); istr >> ws; CPPUNIT_ASSERT( istr.eof() ); CPPUNIT_ASSERT( !istr.fail() ); istr.clear(); } } #endif
Version data entries
135 entries across 135 versions & 2 rubygems