[Scummvm-cvs-logs] SF.net SVN: scummvm:[34369] scummvm/trunk/test/common/str.h
wjpalenstijn at users.sourceforge.net
wjpalenstijn at users.sourceforge.net
Fri Sep 5 22:53:31 CEST 2008
Revision: 34369
http://scummvm.svn.sourceforge.net/scummvm/?rev=34369&view=rev
Author: wjpalenstijn
Date: 2008-09-05 20:53:30 +0000 (Fri, 05 Sep 2008)
Log Message:
-----------
additional Common::String tests
Modified Paths:
--------------
scummvm/trunk/test/common/str.h
Modified: scummvm/trunk/test/common/str.h
===================================================================
--- scummvm/trunk/test/common/str.h 2008-09-05 20:42:41 UTC (rev 34368)
+++ scummvm/trunk/test/common/str.h 2008-09-05 20:53:30 UTC (rev 34369)
@@ -158,6 +158,25 @@
TS_ASSERT_EQUALS(str2, "Test it, NOW! 42");
}
+ void test_deleteChar( void )
+ {
+ Common::String str("01234567890123456789012345678901");
+ str.deleteChar(10);
+ TS_ASSERT_EQUALS( str, "0123456789123456789012345678901" );
+ str.deleteChar(10);
+ TS_ASSERT_EQUALS( str, "012345678923456789012345678901" );
+ }
+
+ void test_sharing( void )
+ {
+ Common::String str("01234567890123456789012345678901");
+ Common::String str2(str);
+ TS_ASSERT_EQUALS( str2, "01234567890123456789012345678901" );
+ str.deleteLastChar();
+ TS_ASSERT_EQUALS( str, "0123456789012345678901234567890" );
+ TS_ASSERT_EQUALS( str2, "01234567890123456789012345678901" );
+ }
+
void test_lastPathComponent(void) {
TS_ASSERT(Common::lastPathComponent("/", '/') == "");
TS_ASSERT(Common::lastPathComponent("/foo/bar", '/') == "bar");
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