ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

void FstreamTest::input ( ) [protected]

Definition at line 105 of file fstream_test.cpp.

{
  {
    ifstream f( "test_file.txt" );
    int i = 0;
    f >> i;
    CPPUNIT_ASSERT( f.good() );
    CPPUNIT_ASSERT( i == 1 );
    double d = 0.0;
    f >> d;
    CPPUNIT_ASSERT( f.good() );
    CPPUNIT_ASSERT( d == 2.0 );
    string str;
    f >> str;
    CPPUNIT_ASSERT( f.good() );
    CPPUNIT_ASSERT( str == "abcd" );
    char c;
    f.get(c); // extract newline, that not extracted by operator >>
    CPPUNIT_ASSERT( f.good() );
    CPPUNIT_ASSERT( c == '\n' );
    getline( f, str );
    CPPUNIT_ASSERT( f.good() );
    CPPUNIT_ASSERT( str == "ghk lm" );
    getline( f, str );
    CPPUNIT_ASSERT( f.eof() );
    CPPUNIT_ASSERT( str == "abcd ef" );
  }
#if defined (STLPORT) && !defined (_STLP_USE_WIN32_IO)
  {
    ifstream in("/tmp");
    if (in.good()) {
      string s;
      getline(in, s);
      CPPUNIT_ASSERT( in.fail() );
    }
  }
#endif
}

Generated on Mon May 28 2012 06:20:45 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.