From da9701d19b41705e39ead61bc56fed1439720216 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 2 Apr 2008 02:15:00 +0000 Subject: Implemented transparent List::iterator to List::const_iterator conversion and updated our tests accordingly. svn-id: r31357 --- test/common/list.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test/common/list.h') 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 container; Common::List::iterator iter; + Common::List::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 ) -- cgit v1.2.3