diff options
author | Max Horn | 2009-04-22 17:52:56 +0000 |
---|---|---|
committer | Max Horn | 2009-04-22 17:52:56 +0000 |
commit | b98f79fe120f3859cace579d21731f137376d5fb (patch) | |
tree | 04b9e855ba6d5f53bbdd228fa5db3826c563168e /test | |
parent | ab05e797157890f4f33c9b9e98c84174bd9bec22 (diff) | |
download | scummvm-rg350-b98f79fe120f3859cace579d21731f137376d5fb.tar.gz scummvm-rg350-b98f79fe120f3859cace579d21731f137376d5fb.tar.bz2 scummvm-rg350-b98f79fe120f3859cace579d21731f137376d5fb.zip |
COMMON: changed class StringList to a simple typedef; enhanced the Common::Array constructor which converts regular arrays to Array objects to be more flexible in its type (allows e.g. to assign an array of char* to a StringList
svn-id: r40077
Diffstat (limited to 'test')
-rw-r--r-- | test/common/array.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/common/array.h b/test/common/array.h index 5ee117e524..52c6529bbc 100644 --- a/test/common/array.h +++ b/test/common/array.h @@ -1,6 +1,7 @@ #include <cxxtest/TestSuite.h> #include "common/array.h" +#include "common/str.h" class ArrayTestSuite : public CxxTest::TestSuite { @@ -151,4 +152,16 @@ class ArrayTestSuite : public CxxTest::TestSuite TS_ASSERT_EQUALS( array2.size(), (unsigned int)3 ); } + + void test_array_constructor_str() { + const char *array1[] = { "a", "b", "c" }; + + Common::StringList array2(array1, 3); + + TS_ASSERT_EQUALS( array2[0], "a" ); + TS_ASSERT_EQUALS( array2[1], "b" ); + TS_ASSERT_EQUALS( array2[2], "c" ); + + TS_ASSERT_EQUALS( array2.size(), (unsigned int)3 ); + } }; |