]> git.saurik.com Git - wxWidgets.git/commitdiff
Unicode compilation fixes
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 31 Mar 2006 13:58:01 +0000 (13:58 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 31 Mar 2006 13:58:01 +0000 (13:58 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38465 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

tests/textfile/textfiletest.cpp

index 63e3a10b7babc8a0e2c7af23b33cbc5670cbaff2..244a7ce9fb742e62e636f59cc977238b91252f66 100644 (file)
@@ -80,7 +80,7 @@ void TextFileTestCase::ReadEmpty()
     CreateTestFile("");
 
     wxTextFile f;
-    CPPUNIT_ASSERT( f.Open(GetTestFileName()) );
+    CPPUNIT_ASSERT( f.Open(wxString::FromAscii(GetTestFileName())) );
 
     CPPUNIT_ASSERT_EQUAL( 0u, f.GetLineCount() );
 }
@@ -90,13 +90,13 @@ void TextFileTestCase::ReadDOS()
     CreateTestFile("foo\r\nbar\r\nbaz");
 
     wxTextFile f;
-    CPPUNIT_ASSERT( f.Open(GetTestFileName()) );
+    CPPUNIT_ASSERT( f.Open(wxString::FromAscii(GetTestFileName())) );
 
     CPPUNIT_ASSERT_EQUAL( 3u, f.GetLineCount() );
     CPPUNIT_ASSERT_EQUAL( wxTextFileType_Dos, f.GetLineType(0) );
     CPPUNIT_ASSERT_EQUAL( wxTextFileType_None, f.GetLineType(2) );
-    CPPUNIT_ASSERT_EQUAL( wxString("bar"), f.GetLine(1) );
-    CPPUNIT_ASSERT_EQUAL( wxString("baz"), f.GetLastLine() );
+    CPPUNIT_ASSERT_EQUAL( wxString(_T("bar")), f.GetLine(1) );
+    CPPUNIT_ASSERT_EQUAL( wxString(_T("baz")), f.GetLastLine() );
 }
 
 void TextFileTestCase::ReadUnix()
@@ -104,13 +104,13 @@ void TextFileTestCase::ReadUnix()
     CreateTestFile("foo\nbar\nbaz");
 
     wxTextFile f;
-    CPPUNIT_ASSERT( f.Open(GetTestFileName()) );
+    CPPUNIT_ASSERT( f.Open(wxString::FromAscii(GetTestFileName())) );
 
     CPPUNIT_ASSERT_EQUAL( 3u, f.GetLineCount() );
     CPPUNIT_ASSERT_EQUAL( wxTextFileType_Unix, f.GetLineType(0) );
     CPPUNIT_ASSERT_EQUAL( wxTextFileType_None, f.GetLineType(2) );
-    CPPUNIT_ASSERT_EQUAL( wxString("bar"), f.GetLine(1) );
-    CPPUNIT_ASSERT_EQUAL( wxString("baz"), f.GetLastLine() );
+    CPPUNIT_ASSERT_EQUAL( wxString(_T("bar")), f.GetLine(1) );
+    CPPUNIT_ASSERT_EQUAL( wxString(_T("baz")), f.GetLastLine() );
 }
 
 void TextFileTestCase::ReadMac()
@@ -118,13 +118,13 @@ void TextFileTestCase::ReadMac()
     CreateTestFile("foo\rbar\rbaz");
 
     wxTextFile f;
-    CPPUNIT_ASSERT( f.Open(GetTestFileName()) );
+    CPPUNIT_ASSERT( f.Open(wxString::FromAscii(GetTestFileName())) );
 
     CPPUNIT_ASSERT_EQUAL( 3u, f.GetLineCount() );
     CPPUNIT_ASSERT_EQUAL( wxTextFileType_Mac, f.GetLineType(0) );
     CPPUNIT_ASSERT_EQUAL( wxTextFileType_None, f.GetLineType(2) );
-    CPPUNIT_ASSERT_EQUAL( wxString("bar"), f.GetLine(1) );
-    CPPUNIT_ASSERT_EQUAL( wxString("baz"), f.GetLastLine() );
+    CPPUNIT_ASSERT_EQUAL( wxString(_T("bar")), f.GetLine(1) );
+    CPPUNIT_ASSERT_EQUAL( wxString(_T("baz")), f.GetLastLine() );
 }
 
 void TextFileTestCase::ReadMixed()
@@ -132,15 +132,15 @@ void TextFileTestCase::ReadMixed()
     CreateTestFile("foo\rbar\r\nbaz\n");
 
     wxTextFile f;
-    CPPUNIT_ASSERT( f.Open(GetTestFileName()) );
+    CPPUNIT_ASSERT( f.Open(wxString::FromAscii(GetTestFileName())) );
 
     CPPUNIT_ASSERT_EQUAL( 3u, f.GetLineCount() );
     CPPUNIT_ASSERT_EQUAL( wxTextFileType_Mac, f.GetLineType(0) );
     CPPUNIT_ASSERT_EQUAL( wxTextFileType_Dos, f.GetLineType(1) );
     CPPUNIT_ASSERT_EQUAL( wxTextFileType_Unix, f.GetLineType(2) );
-    CPPUNIT_ASSERT_EQUAL( wxString("foo"), f.GetFirstLine() );
-    CPPUNIT_ASSERT_EQUAL( wxString("bar"), f.GetLine(1) );
-    CPPUNIT_ASSERT_EQUAL( wxString("baz"), f.GetLastLine() );
+    CPPUNIT_ASSERT_EQUAL( wxString(_T("foo")), f.GetFirstLine() );
+    CPPUNIT_ASSERT_EQUAL( wxString(_T("bar")), f.GetLine(1) );
+    CPPUNIT_ASSERT_EQUAL( wxString(_T("baz")), f.GetLastLine() );
 }
 
 #endif // wxUSE_TEXTFILE