]> git.saurik.com Git - wxWidgets.git/commitdiff
revert r60023 and really fixed compilation problems caused by r60017 by providing...
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 4 Apr 2009 23:55:05 +0000 (23:55 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 4 Apr 2009 23:55:05 +0000 (23:55 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60024 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/cppunit.h
tests/strings/crt.cpp
tests/strings/strings.cpp

index 3f74a8af746cd3e26366018f83af5cb5a9b9bd9c..2cdadbbd776d5a15ad041364c87cbc251013a697 100644 (file)
@@ -87,6 +87,15 @@ CPPUNIT_NS_BEGIN
 
 // provide an overload of cppunit assertEquals(T, T) which can be used to
 // compare wxStrings directly with C strings
+inline void
+assertEquals(const char *expected,
+             const char *actual,
+             CppUnit::SourceLine sourceLine,
+             const std::string& message)
+{
+    assertEquals(wxString(expected), wxString(actual), sourceLine, message);
+}
+
 inline void
 assertEquals(const char *expected,
              const wxString& actual,
index 8233a9e8a23ef0ca365ea29672528e7b42fa7537..61dc5afcc6e05d403c1dfa45d1305ba2588ac779 100644 (file)
@@ -207,8 +207,8 @@ void CrtTestCase::Strpbrk()
     CPPUNIT_ASSERT_EQUAL(  ',', *wxStrpbrk(strWX.c_str(), s.mb_str()) );
     CPPUNIT_ASSERT_EQUAL( L',', *wxStrpbrk(strWX.c_str(), s.wc_str()) );
 
-    CPPUNIT_ASSERT_EQUAL( (char *)NULL, wxStrpbrk(strWX, "xyz") );
-    CPPUNIT_ASSERT_EQUAL( (wchar_t *)NULL, wxStrpbrk(strWX.c_str(), L"xyz") );
+    CPPUNIT_ASSERT( !wxStrpbrk(strWX, "xyz") );
+    CPPUNIT_ASSERT( !wxStrpbrk(strWX.c_str(), L"xyz") );
 }
 
 void CrtTestCase::Strnlen()
index dd3e4a3133bd07e5b469e8e5afb12e752777fe32..87956929e2c65f5383ef37eedb5b0e2440cc434a 100644 (file)
@@ -943,9 +943,9 @@ void StringTestCase::ScopedBuffers()
     // but assigning it to wxCharBuffer makes a full copy
     wxCharBuffer buf(sbuf);
     CPPUNIT_ASSERT( buf.data() != literal );
-    CPPUNIT_ASSERT_EQUAL( literal, buf );
+    CPPUNIT_ASSERT_EQUAL( literal, buf.data() );
 
     wxCharBuffer buf2 = sbuf;
     CPPUNIT_ASSERT( buf2.data() != literal );
-    CPPUNIT_ASSERT_EQUAL( literal, buf );
+    CPPUNIT_ASSERT_EQUAL( literal, buf.data() );
 }