From 5235e068646c0745a891ac6541e855b6417928d0 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Fri, 10 Jan 2003 16:10:00 +0000 Subject: [PATCH] When you pass a negative number as Truncate() argument, the string is truncated to a length of 0 (before Truncate() just did nothing), because it makes more sense (there isn't any problem with R5 compatibility, because here R5's BString just crashed). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2403 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/tests/kits/support/bstring/StringRemoveTest.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tests/kits/support/bstring/StringRemoveTest.cpp b/src/tests/kits/support/bstring/StringRemoveTest.cpp index 87925e1306..ba23b3eb38 100644 --- a/src/tests/kits/support/bstring/StringRemoveTest.cpp +++ b/src/tests/kits/support/bstring/StringRemoveTest.cpp @@ -40,12 +40,12 @@ StringRemoveTest::PerformTest(void) #ifndef TEST_R5 //new length is < 0 //it crashes r5 implementation, but ours works fine here, - //in this case, we ignore the truncation + //in this case, we just truncate to 0 NextSubTest(); string1 = new BString("This is a long string"); string1->Truncate(-3); - CPPUNIT_ASSERT(strcmp(string1->String(), "This is a long string") == 0); - CPPUNIT_ASSERT(string1->Length() == 21); + CPPUNIT_ASSERT(strcmp(string1->String(), "") == 0); + CPPUNIT_ASSERT(string1->Length() == 0); delete string1; #endif