diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-07-25 23:10:34 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-07-26 10:14:29 +0100 |
commit | 56321c27af0774597246aaa54e1cdec5d62855ff (patch) | |
tree | 71d7dc390719d473ef21c13273a4b21dd8662227 /tools | |
parent | 5958f74e8a975115ae3af03cced4f8dde825451e (diff) |
add a test for a nasty suspicion I have
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qa/cppunit/test_streamstate.cxx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tools/qa/cppunit/test_streamstate.cxx b/tools/qa/cppunit/test_streamstate.cxx index 1040dc660a06..c2a4be0c5e00 100644 --- a/tools/qa/cppunit/test_streamstate.cxx +++ b/tools/qa/cppunit/test_streamstate.cxx @@ -68,7 +68,7 @@ namespace aMemStream.Seek(STREAM_SEEK_TO_END); //seeking to end doesn't set eof, reading past eof does - CPPUNIT_ASSERT(!aMemStream.IsEof()); + CPPUNIT_ASSERT(!aMemStream.eof()); CPPUNIT_ASSERT(aMemStream.good()); std_a = 78; @@ -86,7 +86,7 @@ namespace tools_a = 78; aMemStream >> tools_a; //so, now eof is set - CPPUNIT_ASSERT(aMemStream.IsEof()); + CPPUNIT_ASSERT(aMemStream.eof()); //a failed read doesn't change the data, it remains unchanged CPPUNIT_ASSERT(tools_a == 78); //nothing wrong with the stream, so not bad @@ -94,6 +94,15 @@ namespace //yet, the read didn't succeed CPPUNIT_ASSERT(!aMemStream.good()); + sal_uInt16 tools_b = 0x1122; + aMemStream.SeekRel(-1); + CPPUNIT_ASSERT(!aMemStream.eof()); + CPPUNIT_ASSERT(aMemStream.good()); + aMemStream >> tools_b; + CPPUNIT_ASSERT(!aMemStream.good()); + CPPUNIT_ASSERT(aMemStream.eof()); +// CPPUNIT_ASSERT(tools_b == 0x1122); //nasty, real nasty + iss.clear(); iss.seekg(0); CPPUNIT_ASSERT(iss.good()); |