From 56321c27af0774597246aaa54e1cdec5d62855ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Mon, 25 Jul 2011 23:10:34 +0100 Subject: add a test for a nasty suspicion I have --- tools/qa/cppunit/test_streamstate.cxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'tools') 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()); -- cgit v1.2.1