ReactOS 0.4.15-dev-7953-g1f49173
IOStreamTest Class Reference
Inheritance diagram for IOStreamTest:
Collaboration diagram for IOStreamTest:

Private Member Functions

 CPPUNIT_TEST_SUITE (IOStreamTest)
 
 CPPUNIT_TEST (manipulators)
 
 CPPUNIT_TEST (in_avail)
 
 CPPUNIT_TEST_SUITE_END ()
 
void manipulators ()
 
void in_avail ()
 

Detailed Description

Definition at line 18 of file iostream_test.cpp.

Member Function Documentation

◆ CPPUNIT_TEST() [1/2]

IOStreamTest::CPPUNIT_TEST ( in_avail  )
private

◆ CPPUNIT_TEST() [2/2]

IOStreamTest::CPPUNIT_TEST ( manipulators  )
private

◆ CPPUNIT_TEST_SUITE()

IOStreamTest::CPPUNIT_TEST_SUITE ( IOStreamTest  )
private

◆ CPPUNIT_TEST_SUITE_END()

IOStreamTest::CPPUNIT_TEST_SUITE_END ( )
private

◆ in_avail()

void IOStreamTest::in_avail ( )
private

Definition at line 82 of file iostream_test.cpp.

83{
84 CPPUNIT_CHECK( cin.rdbuf()->in_avail() == 0 );
85 CPPUNIT_CHECK( cout.rdbuf()->in_avail() == -1 );
86 CPPUNIT_CHECK( clog.rdbuf()->in_avail() == -1 );
87 CPPUNIT_CHECK( cerr.rdbuf()->in_avail() == -1 );
88
89#if !defined (STLPORT) || !defined (_STLP_NO_WCHAR_T)
90 CPPUNIT_CHECK( wcin.rdbuf()->in_avail() == 0 );
91 CPPUNIT_CHECK( wcout.rdbuf()->in_avail() == 0 );
92 CPPUNIT_CHECK( wclog.rdbuf()->in_avail() == 0 );
93 CPPUNIT_CHECK( wcerr.rdbuf()->in_avail() == 0 );
94#endif
95}
#define CPPUNIT_CHECK(X)
Definition: cppunit_mini.h:195
_STLP_DECLSPEC _Stl_aligned_buffer< wostream > wcout
Definition: iostream.cpp:120
#define cout
Definition: iostream.cpp:38
_STLP_DECLSPEC _Stl_aligned_buffer< wostream > wcerr
Definition: iostream.cpp:121
#define cin
Definition: iostream.cpp:37
#define cerr
Definition: iostream.cpp:39
_STLP_DECLSPEC _Stl_aligned_buffer< wostream > wclog
Definition: iostream.cpp:122
#define clog
Definition: iostream.cpp:40
_STLP_DECLSPEC _Stl_aligned_buffer< wistream > wcin
Definition: iostream.cpp:119

◆ manipulators()

void IOStreamTest::manipulators ( )
private

Definition at line 40 of file iostream_test.cpp.

41{
42 {
43 istringstream istr;
44 istr.str("bar");
45
46 istr >> ws;
47 CPPUNIT_ASSERT( istr.good() );
48
49 string foo;
50 istr >> foo;
51 CPPUNIT_ASSERT( istr.eof() );
52 CPPUNIT_ASSERT( !istr.fail() );
53 CPPUNIT_ASSERT( foo == "bar" );
54
55 istr >> ws;
56 CPPUNIT_ASSERT( istr.eof() );
57 CPPUNIT_ASSERT( !istr.fail() );
58 istr.clear();
59 }
60
61 {
62 istringstream istr;
63 istr.str(" bar ");
64
65 istr >> ws;
66 CPPUNIT_ASSERT( istr.good() );
67
68 string foo;
69 istr >> foo;
70 CPPUNIT_ASSERT( !istr.eof() );
71 CPPUNIT_ASSERT( !istr.fail() );
72 CPPUNIT_ASSERT( foo == "bar" );
73
74 istr >> ws;
75 CPPUNIT_ASSERT( istr.eof() );
76 CPPUNIT_ASSERT( !istr.fail() );
77 istr.clear();
78 }
79}
void clear(iostate __state=goodbit)
Definition: _ios.h:91
_String str() const
Definition: _sstream.h:141
bool fail() const
Definition: _ios_base.h:174
bool eof() const
Definition: _ios_base.h:173
bool good() const
Definition: _ios_base.h:172
#define CPPUNIT_ASSERT(X)
Definition: cppunit_mini.h:200
const char * ws
Definition: skip_ws.cpp:7

The documentation for this class was generated from the following file: