diff options
author | Max Horn | 2009-04-20 19:26:50 +0000 |
---|---|---|
committer | Max Horn | 2009-04-20 19:26:50 +0000 |
commit | faa911794953679a1fff24999878f79612dfc7f3 (patch) | |
tree | 5b05bb39fc9b395f6381ebf81f7f001d8f07a5ca /test/common/list.h | |
parent | 6a7bb77305dc280e6af2afb4beb5cc06ca6350b8 (diff) | |
download | scummvm-rg350-faa911794953679a1fff24999878f79612dfc7f3.tar.gz scummvm-rg350-faa911794953679a1fff24999878f79612dfc7f3.tar.bz2 scummvm-rg350-faa911794953679a1fff24999878f79612dfc7f3.zip |
TESTS: Code formatting; also changed some TS_ASSERT to TS_ASSERT_EQUALS
svn-id: r40026
Diffstat (limited to 'test/common/list.h')
-rw-r--r-- | test/common/list.h | 52 |
1 files changed, 23 insertions, 29 deletions
diff --git a/test/common/list.h b/test/common/list.h index 75a961a604..ef00a0d2a9 100644 --- a/test/common/list.h +++ b/test/common/list.h @@ -5,8 +5,7 @@ class ListTestSuite : public CxxTest::TestSuite { public: - void test_empty_clear( void ) - { + void test_empty_clear() { Common::List<int> container; TS_ASSERT( container.empty() ); container.push_back(17); @@ -17,20 +16,18 @@ class ListTestSuite : public CxxTest::TestSuite } public: - void test_size( void ) - { + void test_size() { Common::List<int> container; - TS_ASSERT( container.size() == 0 ); + TS_ASSERT_EQUALS( container.size(), 0 ); container.push_back(17); - TS_ASSERT( container.size() == 1 ); + TS_ASSERT_EQUALS( container.size(), 1 ); container.push_back(33); - TS_ASSERT( container.size() == 2 ); + TS_ASSERT_EQUALS( container.size(), 2 ); container.clear(); - TS_ASSERT( container.size() == 0 ); + TS_ASSERT_EQUALS( container.size(), 0 ); } - void test_iterator_begin_end( void ) - { + void test_iterator_begin_end() { Common::List<int> container; // The container is initially empty ... @@ -45,8 +42,7 @@ class ListTestSuite : public CxxTest::TestSuite TS_ASSERT( container.begin() == container.end() ); } - void test_iterator( void ) - { + void test_iterator() { Common::List<int> container; Common::List<int>::iterator iter; Common::List<int>::const_iterator cIter; @@ -64,14 +60,14 @@ class ListTestSuite : public CxxTest::TestSuite TS_ASSERT( iter == cIter ); - TS_ASSERT( *iter == 17 ); + TS_ASSERT_EQUALS( *iter, 17 ); ++iter; ++cIter; TS_ASSERT( iter != container.end() ); TS_ASSERT( cIter != container.end() ); TS_ASSERT( iter == cIter ); - TS_ASSERT( *iter == 33 ); + TS_ASSERT_EQUALS( *iter, 33 ); ++iter; ++cIter; TS_ASSERT( iter != container.end() ); @@ -79,7 +75,7 @@ class ListTestSuite : public CxxTest::TestSuite TS_ASSERT( iter == cIter ); // Also test the postinc - TS_ASSERT( *iter == -11 ); + TS_ASSERT_EQUALS( *iter, -11 ); iter++; cIter++; TS_ASSERT( iter == container.end() ); @@ -90,8 +86,7 @@ class ListTestSuite : public CxxTest::TestSuite TS_ASSERT( iter == cIter ); } - void test_insert( void ) - { + void test_insert() { Common::List<int> container; Common::List<int>::iterator iter; @@ -111,29 +106,28 @@ class ListTestSuite : public CxxTest::TestSuite iter = container.begin(); - TS_ASSERT( *iter == 17 ); + TS_ASSERT_EQUALS( *iter, 17 ); ++iter; TS_ASSERT( iter != container.end() ); - TS_ASSERT( *iter == 33 ); + TS_ASSERT_EQUALS( *iter, 33 ); ++iter; TS_ASSERT( iter != container.end() ); - TS_ASSERT( *iter == 42 ); + TS_ASSERT_EQUALS( *iter, 42 ); ++iter; TS_ASSERT( iter != container.end() ); - TS_ASSERT( *iter == 43 ); + TS_ASSERT_EQUALS( *iter, 43 ); ++iter; TS_ASSERT( iter != container.end() ); - TS_ASSERT( *iter == -11 ); + TS_ASSERT_EQUALS( *iter, -11 ); ++iter; TS_ASSERT( iter == container.end() ); } - void test_reverse( void ) - { + void test_reverse() { Common::List<int> container; Common::List<int>::iterator iter; @@ -146,15 +140,15 @@ class ListTestSuite : public CxxTest::TestSuite TS_ASSERT( iter != container.end() ); - TS_ASSERT( *iter == -11 ); + TS_ASSERT_EQUALS( *iter, -11 ); --iter; TS_ASSERT( iter != container.end() ); - TS_ASSERT( *iter == 33 ); + TS_ASSERT_EQUALS( *iter, 33 ); --iter; TS_ASSERT( iter != container.end() ); - TS_ASSERT( *iter == 17 ); + TS_ASSERT_EQUALS( *iter, 17 ); --iter; TS_ASSERT( iter == container.end() ); @@ -162,11 +156,11 @@ class ListTestSuite : public CxxTest::TestSuite iter = container.reverse_erase(iter); TS_ASSERT( iter != container.end() ); - TS_ASSERT( *iter == 33 ); + TS_ASSERT_EQUALS( *iter, 33 ); iter = container.reverse_erase(iter); TS_ASSERT( iter != container.end() ); - TS_ASSERT( *iter == 17 ); + TS_ASSERT_EQUALS( *iter, 17 ); iter = container.reverse_erase(iter); TS_ASSERT( iter == container.end() ); |