aboutsummaryrefslogtreecommitdiff
path: root/test/common/list.h
diff options
context:
space:
mode:
authorJohannes Schickel2008-04-02 02:15:00 +0000
committerJohannes Schickel2008-04-02 02:15:00 +0000
commitda9701d19b41705e39ead61bc56fed1439720216 (patch)
treef9cdc51910d5a26e1a8717dc52170d911d5051ed /test/common/list.h
parent8436943bfd4aace76c16a4c4404c5e9dbc0a41f0 (diff)
downloadscummvm-rg350-da9701d19b41705e39ead61bc56fed1439720216.tar.gz
scummvm-rg350-da9701d19b41705e39ead61bc56fed1439720216.tar.bz2
scummvm-rg350-da9701d19b41705e39ead61bc56fed1439720216.zip
Implemented transparent List::iterator to List::const_iterator conversion and updated our tests accordingly.
svn-id: r31357
Diffstat (limited to 'test/common/list.h')
-rw-r--r--test/common/list.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/common/list.h b/test/common/list.h
index c206dbe009..356693c33e 100644
--- a/test/common/list.h
+++ b/test/common/list.h
@@ -36,6 +36,7 @@ class ListTestSuite : public CxxTest::TestSuite
{
Common::List<int> container;
Common::List<int>::iterator iter;
+ Common::List<int>::const_iterator cIter;
// Fill the container with some random data
container.push_back(17);
@@ -46,19 +47,34 @@ class ListTestSuite : public CxxTest::TestSuite
// the order we expect them to be.
iter = container.begin();
+ cIter = container.begin();
+
+ TS_ASSERT( iter == cIter );
TS_ASSERT( *iter == 17 );
++iter;
+ ++cIter;
TS_ASSERT( iter != container.end() );
+ TS_ASSERT( cIter != container.end() );
+ TS_ASSERT( iter == cIter );
TS_ASSERT( *iter == 33 );
++iter;
+ ++cIter;
TS_ASSERT( iter != container.end() );
+ TS_ASSERT( cIter != container.end() );
+ TS_ASSERT( iter == cIter );
// Also test the postinc
TS_ASSERT( *iter == -11 );
iter++;
+ cIter++;
TS_ASSERT( iter == container.end() );
+ TS_ASSERT( cIter == container.end() );
+ TS_ASSERT( iter == cIter );
+
+ cIter = iter;
+ TS_ASSERT( iter == cIter );
}
void test_insert( void )