]> git.saurik.com Git - wxWidgets.git/commitdiff
the expected test result was wrong, corrected; also define a manifest constant only...
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 31 Mar 2006 19:24:23 +0000 (19:24 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 31 Mar 2006 19:24:23 +0000 (19:24 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38483 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

tests/strings/unicode.cpp

index bf2aace2cceb4dd9c03224740726f228c5077d0e..3ccf6be1dbfe3db0c6308c85982b6315f3a9c34e 100644 (file)
@@ -138,14 +138,18 @@ void UnicodeTestCase::ConstructorsWithConversion()
 void UnicodeTestCase::Conversion()
 {
 #if wxUSE_UNICODE
-        wxString szTheString(L"The\0String", wxConvLibc, 10);
+        static const size_t lenNulString = 10;
+
+        wxString szTheString(L"The\0String", wxConvLibc, lenNulString);
         wxCharBuffer theBuffer = szTheString.mb_str();
 
-        CPPUNIT_ASSERT( memcmp(theBuffer.data(), "The\0String", 11) == 0 );
+        CPPUNIT_ASSERT( memcmp(theBuffer.data(), "The\0String",
+                        lenNulString + 1) == 0 );
 
-        wxString szTheString2("The\0String", wxConvLocal, 10);
-        CPPUNIT_ASSERT( szTheString2.length() == 11 );
-        CPPUNIT_ASSERT( wxTmemcmp(szTheString2.c_str(), L"The\0String", 11) == 0 );
+        wxString szTheString2("The\0String", wxConvLocal, lenNulString);
+        CPPUNIT_ASSERT_EQUAL( lenNulString, szTheString2.length() );
+        CPPUNIT_ASSERT( wxTmemcmp(szTheString2.c_str(), L"The\0String",
+                        lenNulString + 1) == 0 );
 #else
         wxString szTheString(wxT("TheString"));
         szTheString.insert(3, 1, '\0');