aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-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() {