[Scummvm-cvs-logs] SF.net SVN: scummvm:[41083] scummvm/trunk/test/common/str.h
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Mon Jun 1 00:19:38 CEST 2009
Revision: 41083
http://scummvm.svn.sourceforge.net/scummvm/?rev=41083&view=rev
Author: lordhoto
Date: 2009-05-31 22:19:38 +0000 (Sun, 31 May 2009)
Log Message:
-----------
Extend self asignment test a bit more (both using internal and allocated storage).
Modified Paths:
--------------
scummvm/trunk/test/common/str.h
Modified: scummvm/trunk/test/common/str.h
===================================================================
--- scummvm/trunk/test/common/str.h 2009-05-31 22:11:06 UTC (rev 41082)
+++ scummvm/trunk/test/common/str.h 2009-05-31 22:19:38 UTC (rev 41083)
@@ -145,6 +145,27 @@
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() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list