]> git.saurik.com Git - wxWidgets.git/commitdiff
use CPPUNIT_ASSERT_EQUAL instead of CPPUNIT_ASSERT as this gives more detailed inform...
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 13 Jun 2007 14:29:02 +0000 (14:29 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 13 Jun 2007 14:29:02 +0000 (14:29 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46446 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

tests/strings/crt.cpp

index 68b752c295d5abf11dbcc26f4fe53d8225776bfa..ea161f91a2847336766829312e4fdb025d8721b0 100644 (file)
@@ -138,42 +138,42 @@ void CrtTestCase::Strcmp()
 
 void CrtTestCase::Strspn()
 {
-    CPPUNIT_ASSERT( wxStrspn(strMB, "xyz") == 0 );
-    CPPUNIT_ASSERT( wxStrspn(strWC, "xyz") == 0 );
-    CPPUNIT_ASSERT( wxStrspn(strWX, "xyz") == 0 );
-    CPPUNIT_ASSERT( wxStrspn(strMB, L"xyz") == 0 );
-    CPPUNIT_ASSERT( wxStrspn(strWC, L"xyz") == 0 );
-    CPPUNIT_ASSERT( wxStrspn(strWX, L"xyz") == 0 );
-
-    CPPUNIT_ASSERT( wxStrspn(strMB, "hleo") == 5 );
-    CPPUNIT_ASSERT( wxStrspn(strWC, "hleo") == 5 );
-    CPPUNIT_ASSERT( wxStrspn(strWX, "hleo") == 5 );
-
-    CPPUNIT_ASSERT( wxStrspn(strMB, "ld") == 0 );
-    CPPUNIT_ASSERT( wxStrspn(strWC, "ld") == 0 );
-    CPPUNIT_ASSERT( wxStrspn(strWX, "ld") == 0 );
-
-    CPPUNIT_ASSERT( wxStrspn(strMB, strWC) == strWX.length() );
-    CPPUNIT_ASSERT( wxStrspn(strWC, strWX) == strWX.length() );
-    CPPUNIT_ASSERT( wxStrspn(strWX, strMB) == strWX.length() );
+    CPPUNIT_ASSERT_EQUAL( (size_t)0, wxStrspn(strMB, "xyz") );
+    CPPUNIT_ASSERT_EQUAL( (size_t)0, wxStrspn(strWC, "xyz") );
+    CPPUNIT_ASSERT_EQUAL( (size_t)0, wxStrspn(strWX, "xyz") );
+    CPPUNIT_ASSERT_EQUAL( (size_t)0, wxStrspn(strMB, L"xyz") );
+    CPPUNIT_ASSERT_EQUAL( (size_t)0, wxStrspn(strWC, L"xyz") );
+    CPPUNIT_ASSERT_EQUAL( (size_t)0, wxStrspn(strWX, L"xyz") );
+
+    CPPUNIT_ASSERT_EQUAL( (size_t)5, wxStrspn(strMB, "hleo") );
+    CPPUNIT_ASSERT_EQUAL( (size_t)5, wxStrspn(strWC, "hleo") );
+    CPPUNIT_ASSERT_EQUAL( (size_t)5, wxStrspn(strWX, "hleo") );
+
+    CPPUNIT_ASSERT_EQUAL( (size_t)0, wxStrspn(strMB, "ld") );
+    CPPUNIT_ASSERT_EQUAL( (size_t)0, wxStrspn(strWC, "ld") );
+    CPPUNIT_ASSERT_EQUAL( (size_t)0, wxStrspn(strWX, "ld") );
+
+    CPPUNIT_ASSERT_EQUAL( strWX.length(), wxStrspn(strMB, strWC) );
+    CPPUNIT_ASSERT_EQUAL( strWX.length(), wxStrspn(strWC, strWX) );
+    CPPUNIT_ASSERT_EQUAL( strWX.length(), wxStrspn(strWX, strMB) );
 }
 
 void CrtTestCase::Strcspn()
 {
-    CPPUNIT_ASSERT( wxStrcspn(strMB, strWX) == 0 );
-    CPPUNIT_ASSERT( wxStrcspn(strWC, strMB) == 0 );
-    CPPUNIT_ASSERT( wxStrcspn(strWX, strWC) == 0 );
+    CPPUNIT_ASSERT_EQUAL( (size_t)0, wxStrcspn(strMB, strWX) );
+    CPPUNIT_ASSERT_EQUAL( (size_t)0, wxStrcspn(strWC, strMB) );
+    CPPUNIT_ASSERT_EQUAL( (size_t)0, wxStrcspn(strWX, strWC) );
 
-    CPPUNIT_ASSERT( wxStrcspn(strMB, ", ") == 5 );
-    CPPUNIT_ASSERT( wxStrcspn(strWC, ", ") == 5 );
-    CPPUNIT_ASSERT( wxStrcspn(strWX, ", ") == 5 );
+    CPPUNIT_ASSERT_EQUAL( (size_t)5, wxStrcspn(strMB, ", ") );
+    CPPUNIT_ASSERT_EQUAL( (size_t)5, wxStrcspn(strWC, ", ") );
+    CPPUNIT_ASSERT_EQUAL( (size_t)5, wxStrcspn(strWX, ", ") );
 
-    CPPUNIT_ASSERT( wxStrcspn(strMB, "hel") == 0 );
-    CPPUNIT_ASSERT( wxStrcspn(strWC, "hel") == 0 );
-    CPPUNIT_ASSERT( wxStrcspn(strWX, "hel") == 0 );
+    CPPUNIT_ASSERT_EQUAL( (size_t)0, wxStrcspn(strMB, "hel") );
+    CPPUNIT_ASSERT_EQUAL( (size_t)0, wxStrcspn(strWC, "hel") );
+    CPPUNIT_ASSERT_EQUAL( (size_t)0, wxStrcspn(strWX, "hel") );
 
-    CPPUNIT_ASSERT( wxStrcspn(strMB, "xy") == strWX.length() );
-    CPPUNIT_ASSERT( wxStrcspn(strWC, "xy") == strWX.length() );
-    CPPUNIT_ASSERT( wxStrcspn(strWX, "xy") == strWX.length() );
+    CPPUNIT_ASSERT_EQUAL( strWX.length(), wxStrcspn(strMB, "xy") );
+    CPPUNIT_ASSERT_EQUAL( strWX.length(), wxStrcspn(strWC, "xy") );
+    CPPUNIT_ASSERT_EQUAL( strWX.length(), wxStrcspn(strWX, "xy") );
 }