backport WX_ASSERT_SIZET_EQUAL from trunk, use it to fix compilation of the test on 64 bit platforms

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@48984 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-09-28 22:15:08 +00:00
parent d1cc3f3463
commit 0f6089b1b7
2 changed files with 8 additions and 2 deletions

View File

@@ -77,6 +77,12 @@
#define WXTEST_FAIL_WITH_CONDITION(suiteName, Condition, testMethod) \
WXTEST_ANY_WITH_CONDITION(suiteName, Condition, testMethod, CPPUNIT_TEST_FAIL(testMethod))
// Use this macro to compare a wxString with a literal string.
#define WX_ASSERT_STR_EQUAL(p, s) CPPUNIT_ASSERT_EQUAL(wxString(p), s)
// Use this macro to compare a size_t with a literal integer
#define WX_ASSERT_SIZET_EQUAL(n, m) CPPUNIT_ASSERT_EQUAL(((size_t)n), m)
///////////////////////////////////////////////////////////////////////////////
// stream inserter for wxString

View File

@@ -615,7 +615,7 @@ void StringTestCase::WriteBuf()
CPPUNIT_ASSERT_EQUAL(_T('f'), s[0u]);
CPPUNIT_ASSERT_EQUAL(_T('o'), s[1]);
CPPUNIT_ASSERT_EQUAL(_T('o'), s[2]);
CPPUNIT_ASSERT_EQUAL(3u, s.length());
WX_ASSERT_SIZET_EQUAL(3, s.length());
{
wxChar *p = s.GetWriteBuf(10);
@@ -626,7 +626,7 @@ void StringTestCase::WriteBuf()
CPPUNIT_ASSERT_EQUAL(_T('a'), s[1]);
CPPUNIT_ASSERT_EQUAL(_T('r'), s[2]);
CPPUNIT_ASSERT_EQUAL(_T('r'), s[3]);
CPPUNIT_ASSERT_EQUAL(4u, s.length());
WX_ASSERT_SIZET_EQUAL(4, s.length());
CPPUNIT_ASSERT_EQUAL( 0, wxStrcmp(_T("barr"), s) );
}