X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/abbb59e8eb995f445759df30ee507c74af690b51..197ab43d72571ecfd86c35f1832f063237775648:/tests/arrays/arrays.cpp diff --git a/tests/arrays/arrays.cpp b/tests/arrays/arrays.cpp index 8d05e0ca8d..a5a26644f3 100644 --- a/tests/arrays/arrays.cpp +++ b/tests/arrays/arrays.cpp @@ -82,7 +82,7 @@ public: static size_t GetNumber() { return ms_bars; } - const wxChar *GetName() const { return m_name; } + const wxChar *GetName() const { return m_name.c_str(); } private: wxString m_name; @@ -94,7 +94,7 @@ size_t Bar::ms_bars = 0; WX_DECLARE_OBJARRAY(Bar, ArrayBars); #include "wx/arrimpl.cpp" -WX_DEFINE_OBJARRAY(ArrayBars); +WX_DEFINE_OBJARRAY(ArrayBars) // ---------------------------------------------------------------------------- // helpers for sorting arrays and comparing items @@ -125,9 +125,9 @@ 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); +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); @@ -139,6 +139,15 @@ WX_DEFINE_SORTED_ARRAY_CMP_SHORT(ushort, UShortCompareValues, wxSortedArrayUShor WX_DEFINE_SORTED_ARRAY_CMP_INT(int, IntCompareValues, wxSortedArrayInt); +struct Item +{ + Item(int n_ = 0) : n(n_) { } + + int n; +}; + +WX_DEFINE_ARRAY_PTR(Item *, ItemPtrArray); + // ---------------------------------------------------------------------------- // test class // ---------------------------------------------------------------------------- @@ -161,6 +170,8 @@ private: CPPUNIT_TEST( wxArrayCharTest ); CPPUNIT_TEST( TestSTL ); CPPUNIT_TEST( Alloc ); + CPPUNIT_TEST( Clear ); + CPPUNIT_TEST( Swap ); CPPUNIT_TEST_SUITE_END(); void wxStringArrayTest(); @@ -173,6 +184,8 @@ private: void wxArrayCharTest(); void TestSTL(); void Alloc(); + void Clear(); + void Swap(); DECLARE_NO_COPY_CLASS(ArraysTestCase) }; @@ -424,7 +437,8 @@ void ArraysTestCase::wxStringArraySplitJoinTest() wxT("