X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7788fc4046f6ff5fb6a2ef67906cecc32e7b4df8..a2f2764dfb323c70488243f8aa791e2bf780cb0a:/tests/arrays/arrays.cpp diff --git a/tests/arrays/arrays.cpp b/tests/arrays/arrays.cpp index c6fa3f3bd4..a776a2c1db 100644 --- a/tests/arrays/arrays.cpp +++ b/tests/arrays/arrays.cpp @@ -125,12 +125,18 @@ int wxCMPFUNC_CONV name ## RevCompare(T* first, T* second) \ typedef unsigned short ushort; +DEFINE_COMPARE(Char, char); DEFINE_COMPARE(UShort, ushort); DEFINE_COMPARE(Int, int); +WX_DEFINE_ARRAY_CHAR(char, wxArrayChar); +WX_DEFINE_SORTED_ARRAY_CHAR(char, wxSortedArrayCharNoCmp); +WX_DEFINE_SORTED_ARRAY_CMP_CHAR(char, CharCompareValues, wxSortedArrayChar); + WX_DEFINE_ARRAY_SHORT(ushort, wxArrayUShort); WX_DEFINE_SORTED_ARRAY_SHORT(ushort, wxSortedArrayUShortNoCmp); WX_DEFINE_SORTED_ARRAY_CMP_SHORT(ushort, UShortCompareValues, wxSortedArrayUShort); + WX_DEFINE_SORTED_ARRAY_CMP_INT(int, IntCompareValues, wxSortedArrayInt); // ---------------------------------------------------------------------------- @@ -148,6 +154,7 @@ private: CPPUNIT_TEST( wxObjArrayTest ); CPPUNIT_TEST( wxArrayUShortTest ); CPPUNIT_TEST( wxArrayIntTest ); + CPPUNIT_TEST( wxArrayCharTest ); CPPUNIT_TEST( TestSTL ); CPPUNIT_TEST( Alloc ); CPPUNIT_TEST_SUITE_END(); @@ -156,6 +163,7 @@ private: void wxObjArrayTest(); void wxArrayUShortTest(); void wxArrayIntTest(); + void wxArrayCharTest(); void TestSTL(); void Alloc(); @@ -359,6 +367,8 @@ void ArraysTestCase::wxArray ## name ## Test() \ TestArrayOf(UShort); +TestArrayOf(Char); + TestArrayOf(Int); void ArraysTestCase::Alloc() @@ -366,11 +376,11 @@ void ArraysTestCase::Alloc() wxArrayInt a; a.Add(17); a.Add(9); - CPPUNIT_ASSERT_EQUAL( 2u, a.GetCount() ); + CPPUNIT_ASSERT_EQUAL( size_t(2), a.GetCount() ); a.Alloc(1000); - CPPUNIT_ASSERT_EQUAL( 2u, a.GetCount() ); + CPPUNIT_ASSERT_EQUAL( size_t(2), a.GetCount() ); CPPUNIT_ASSERT_EQUAL( 17, a[0] ); CPPUNIT_ASSERT_EQUAL( 9, a[1] ); }