aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2009-05-31 22:19:38 +0000
committerJohannes Schickel2009-05-31 22:19:38 +0000
commit0f8926982a3e9d18b23168d9c70e371fe6ecfbee (patch)
treeed754aea6d3c5714b7a30c764cfb844873101da5
parentb0f49a6211b1f945c208b19a19840c7d32485334 (diff)
downloadscummvm-rg350-0f8926982a3e9d18b23168d9c70e371fe6ecfbee.tar.gz
scummvm-rg350-0f8926982a3e9d18b23168d9c70e371fe6ecfbee.tar.bz2
scummvm-rg350-0f8926982a3e9d18b23168d9c70e371fe6ecfbee.zip
Extend self asignment test a bit more (both using internal and allocated storage).
svn-id: r41083
-rw-r--r--test/common/str.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/common/str.h b/test/common/str.h
index c37d94d72a..1e92dc0b7f 100644
--- a/test/common/str.h
+++ b/test/common/str.h
@@ -145,6 +145,27 @@ class StringTestSuite : public CxxTest::TestSuite
Common::String foo6("123456789012");
foo6 += foo6;
TS_ASSERT_EQUALS(foo6, "123456789012""123456789012");
+
+ // "foo7" and "foo8" will purely operate on internal storage.
+ Common::String foo7("1234");
+ foo7 += foo7.c_str();
+ TS_ASSERT_EQUALS(foo7, "1234""1234");
+
+ Common::String foo8("1234");
+ foo8 += foo8;
+ TS_ASSERT_EQUALS(foo8, "1234""1234");
+
+ Common::String foo9("123456789012345678901234567889012");
+ foo9 = foo9.c_str();
+ TS_ASSERT_EQUALS(foo9, "123456789012345678901234567889012");
+ foo9 = foo9;
+ TS_ASSERT_EQUALS(foo9, "123456789012345678901234567889012");
+
+ Common::String foo10("1234");
+ foo10 = foo10.c_str();
+ TS_ASSERT_EQUALS(foo10, "1234");
+ foo10 = foo10;
+ TS_ASSERT_EQUALS(foo10, "1234");
}
void test_hasPrefix() {