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);
// ----------------------------------------------------------------------------
CPPUNIT_TEST( wxObjArrayTest );
CPPUNIT_TEST( wxArrayUShortTest );
CPPUNIT_TEST( wxArrayIntTest );
+ CPPUNIT_TEST( wxArrayCharTest );
CPPUNIT_TEST( TestSTL );
+ CPPUNIT_TEST( Alloc );
CPPUNIT_TEST_SUITE_END();
void wxStringArrayTest();
void wxObjArrayTest();
void wxArrayUShortTest();
void wxArrayIntTest();
+ void wxArrayCharTest();
void TestSTL();
+ void Alloc();
DECLARE_NO_COPY_CLASS(ArraysTestCase)
};
TestArrayOf(UShort);
+TestArrayOf(Char);
+
TestArrayOf(Int);
+void ArraysTestCase::Alloc()
+{
+ wxArrayInt a;
+ a.Add(17);
+ a.Add(9);
+ CPPUNIT_ASSERT_EQUAL( size_t(2), a.GetCount() );
+
+ a.Alloc(1000);
+
+ CPPUNIT_ASSERT_EQUAL( size_t(2), a.GetCount() );
+ CPPUNIT_ASSERT_EQUAL( 17, a[0] );
+ CPPUNIT_ASSERT_EQUAL( 9, a[1] );
+}
+
void ArraysTestCase::TestSTL()
{
wxArrayInt list1;