diff options
author | Max Horn | 2009-04-27 14:23:20 +0000 |
---|---|---|
committer | Max Horn | 2009-04-27 14:23:20 +0000 |
commit | e579f91b5c1b0949954037acf5bb4b364bfeb2b5 (patch) | |
tree | 3665306d61515c640885ce0bbec9b4d9c3a82d7d /test/common/list.h | |
parent | 6322478508e4a2a412efdb819b38d54c067cbbb6 (diff) | |
download | scummvm-rg350-e579f91b5c1b0949954037acf5bb4b364bfeb2b5.tar.gz scummvm-rg350-e579f91b5c1b0949954037acf5bb4b364bfeb2b5.tar.bz2 scummvm-rg350-e579f91b5c1b0949954037acf5bb4b364bfeb2b5.zip |
COMMON: Made sure Common::List and Common::array each have all front/back/push_back/push_front, as have their STL counterparts
svn-id: r40163
Diffstat (limited to 'test/common/list.h')
-rw-r--r-- | test/common/list.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/common/list.h b/test/common/list.h index 629150d554..67db1e1a42 100644 --- a/test/common/list.h +++ b/test/common/list.h @@ -168,4 +168,23 @@ class ListTestSuite : public CxxTest::TestSuite TS_ASSERT( container.begin() == container.end() ); TS_ASSERT( container.reverse_begin() == container.end() ); } + + void test_front_back_push_pop() { + Common::List<int> container; + + container.push_back( 42); + container.push_back(-23); + + TS_ASSERT_EQUALS(container.front(), 42); + TS_ASSERT_EQUALS(container.back(), -23); + + container.front() = -17; + container.back() = 163; + TS_ASSERT_EQUALS(container.front(), -17); + TS_ASSERT_EQUALS(container.back(), 163); + + container.pop_front(); + TS_ASSERT_EQUALS(container.front(), 163); + TS_ASSERT_EQUALS(container.back(), 163); + } }; |