13 #include <utl/TypeLabeledContainer.h>
15 #include <tst/Verify.h>
16 #include <cppunit/extensions/HelperMacros.h>
23 #define ASSERT_EQUAL(x, y) CPPUNIT_ASSERT(Verify<Equal>(x, y))
33 Foo() { fLabel = 10; }
37 Bar() { fLabel = 20; }
41 Baz() { fLabel = 320; }
48 CPPUNIT_TEST(TestInsert);
49 CPPUNIT_TEST_SUITE_END();
52 void setUp() { cerr <<
"\nTestTypeLabeledContainer: Start\n"; }
54 void tearDown() { cerr <<
"TestTypeLabeledContainer: Stop" << endl; }
56 template<
class Cast,
class T>
61 for (
typename T::template Iterator<Cast> it = c.template Begin<Cast>();
62 it != c.template End<Cast>(); ++it) {
69 template<
class Cast,
class T>
74 for (
typename T::template ConstIterator<Cast> it = c.template Begin<Cast>();
75 it != c.template End<Cast>(); ++it) {
88 Baz*
const bbb[] = {
new Baz,
new Baz,
new Baz };
98 const MyContainer& d =
c;
100 TestIterator<Base>(
c, 0, 1);
101 TestConstIterator<Base>(d, 0, 1);
103 TestIterator<Foo>(
c, 10, 1);
104 TestConstIterator<Foo>(d, 10, 1);
106 TestIterator<Bar>(
c, 20, 2);
107 TestConstIterator<Bar>(d, 20, 2);
109 TestIterator<Baz>(
c, 320, 3);
110 TestConstIterator<Baz>(d, 320, 3);
void TestConstIterator(T &c, const int label, const int count)
container of classes with common base, labeled by concrete type
void TestIterator(T &c, const int label, const int count)
CPPUNIT_TEST_SUITE_REGISTRATION(testAiresShowerFile)
#define ASSERT_EQUAL(x, y)