]> git.saurik.com Git - wxWidgets.git/commitdiff
use CPPUNIT_ASSERT_EQUAL(x,y) instead of CPPUNIT_ASSERT(x==y) to better see test...
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 15 Jul 2008 17:38:03 +0000 (17:38 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 15 Jul 2008 17:38:03 +0000 (17:38 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54642 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

tests/strings/unicode.cpp

index 2abae879ac45ced46fbb4c7e88c710ca15df726e..f40fdb118b02ba21339369e22a33736b4ba3e8d9 100644 (file)
@@ -130,35 +130,36 @@ void UnicodeTestCase::ConstructorsWithConversion()
     wxString s2(wchar, wxConvUTF8);
 
 #if wxUSE_UNICODE
-    CPPUNIT_ASSERT( s1 == wchar );
-    CPPUNIT_ASSERT( s2 == wchar );
+    WX_ASSERT_STR_EQUAL( wchar, s1 );
+    WX_ASSERT_STR_EQUAL( wchar, s2 );
 #else
-    CPPUNIT_ASSERT( s1 == utf8 );
-    CPPUNIT_ASSERT( s2 == utf8 );
+    WX_ASSERT_STR_EQUAL( utf8, s1 );
+    WX_ASSERT_STR_EQUAL( utf8, s2 );
 #endif
 
     wxString sub(utf8sub, wxConvUTF8); // "Dej" substring
     wxString s3(utf8, wxConvUTF8, 4);
     wxString s4(wchar, wxConvUTF8, 3);
 
-    CPPUNIT_ASSERT( s3 == sub );
-    CPPUNIT_ASSERT( s4 == sub );
+    CPPUNIT_ASSERT_EQUAL( sub, s3 );
+    CPPUNIT_ASSERT_EQUAL( sub, s4 );
 
 #if wxUSE_UNICODE
-    CPPUNIT_ASSERT ( wxString("\t[pl]open.format.Sformatuj dyskietkê=gfloppy %f", 
-                               wxConvUTF8) == wxT("") ); //should stop at pos 35 
+    // conversion should stop with failure at pos 35
+    wxString s("\t[pl]open.format.Sformatuj dyskietkê=gfloppy %f", wxConvUTF8);
+    CPPUNIT_ASSERT( s.empty() );
 #endif
 
 
     // test using Unicode strings together with char* strings (this must work
     // in ANSI mode as well, of course):
     wxString s5("ascii");
-    CPPUNIT_ASSERT( s5 == "ascii" );
+    WX_ASSERT_STR_EQUAL( "ascii", s5 );
 
     s5 += " value";
 
     CPPUNIT_ASSERT( strcmp(s5.mb_str(), "ascii value") == 0 );
-    CPPUNIT_ASSERT( s5 == "ascii value" );
+    WX_ASSERT_STR_EQUAL( "ascii value", s5 );
     CPPUNIT_ASSERT( s5 != "SomethingElse" );
 }