summaryrefslogtreecommitdiff
path: root/tools/qa
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-01-16 15:05:25 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-01-16 15:40:53 +0000
commit94a8737a54c9e2c320e0be0286a5ecc0d354b8cc (patch)
tree6500174f26d289dac6f30d60a9b73ac03ddf679c /tools/qa
parente770d5300054d56545bba3c16635a14e92fde807 (diff)
drop strange embedded null handling behaviour
Diffstat (limited to 'tools/qa')
-rw-r--r--tools/qa/cppunit/test_stream.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/tools/qa/cppunit/test_stream.cxx b/tools/qa/cppunit/test_stream.cxx
index 107d1c1047c4..16293d0eafad 100644
--- a/tools/qa/cppunit/test_stream.cxx
+++ b/tools/qa/cppunit/test_stream.cxx
@@ -264,16 +264,14 @@ namespace
aMemStream.Seek(0);
bRet = aMemStream.ReadLine(aFoo);
CPPUNIT_ASSERT(bRet);
- //This is the weird current behavior where an embedded null is read but
- //discarded
- CPPUNIT_ASSERT(aFoo.equalsL(RTL_CONSTASCII_STRINGPARAM("foobar"))); //<--diff A
+ CPPUNIT_ASSERT(aFoo.getLength() == 7 && aFoo[3] == 0);
CPPUNIT_ASSERT(aMemStream.good());
std::string sStr(RTL_CONSTASCII_STRINGPARAM(foo));
std::istringstream iss(sStr, std::istringstream::in);
std::getline(iss, sStr, '\n');
//embedded null read as expected
- CPPUNIT_ASSERT(sStr.size() == 7 && sStr[3] == 0); //<--diff A
+ CPPUNIT_ASSERT(sStr.size() == 7 && sStr[3] == 0);
CPPUNIT_ASSERT(iss.good());
bRet = aMemStream.ReadLine(aFoo);
@@ -299,12 +297,12 @@ namespace
bRet = aMemStreamB.ReadLine(aFoo);
CPPUNIT_ASSERT(bRet);
CPPUNIT_ASSERT(aFoo.equalsL(RTL_CONSTASCII_STRINGPARAM("foo")));
- CPPUNIT_ASSERT(!aMemStreamB.eof()); //<-- diff B
+ CPPUNIT_ASSERT(!aMemStreamB.eof()); //<-- diff A
std::istringstream issB(bar, std::istringstream::in);
std::getline(issB, sStr, '\n');
CPPUNIT_ASSERT(sStr == "foo");
- CPPUNIT_ASSERT(issB.eof()); //<-- diff B
+ CPPUNIT_ASSERT(issB.eof()); //<-- diff A
}
CPPUNIT_TEST_SUITE_REGISTRATION(Test);