]>
git.saurik.com Git - wxWidgets.git/blob - tests/vectors/vectors.cpp
ca75e21942230d4a2e3773bf915fab2555b7bead
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: tests/vectors/vectors.cpp
3 // Purpose: wxVector<T> unit test
4 // Author: Vaclav Slavik
7 // Copyright: (c) 2007 Vaclav Slavik
8 ///////////////////////////////////////////////////////////////////////////////
10 // ----------------------------------------------------------------------------
12 // ----------------------------------------------------------------------------
24 #include "wx/vector.h"
26 // --------------------------------------------------------------------------
28 // --------------------------------------------------------------------------
30 class VectorsTestCase
: public CppUnit::TestCase
36 CPPUNIT_TEST_SUITE( VectorsTestCase
);
37 CPPUNIT_TEST( PushTest
);
38 CPPUNIT_TEST_SUITE_END();
42 DECLARE_NO_COPY_CLASS(VectorsTestCase
)
45 // register in the unnamed registry so that these tests are run by default
46 CPPUNIT_TEST_SUITE_REGISTRATION( VectorsTestCase
);
48 // also include in it's own registry so that these tests can be run alone
49 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( VectorsTestCase
, "VectorsTestCase" );
51 void VectorsTestCase::PushTest()
55 CPPUNIT_ASSERT( v
.size() == 0 );
57 CPPUNIT_ASSERT( v
.size() == 1 );
59 CPPUNIT_ASSERT( v
.size() == 2 );
61 CPPUNIT_ASSERT( v
.size() == 3 );
63 CPPUNIT_ASSERT( v
[0] == 1 );
64 CPPUNIT_ASSERT( v
[1] == 2 );
65 CPPUNIT_ASSERT( v
[2] == 42 );