From: Vadim Zeitlin Date: Fri, 31 Mar 2006 13:58:01 +0000 (+0000) Subject: Unicode compilation fixes X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/18230eb6b61b4db7907efb00814847dc1e4b9d4d Unicode compilation fixes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38465 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/tests/textfile/textfiletest.cpp b/tests/textfile/textfiletest.cpp index 63e3a10b7b..244a7ce9fb 100644 --- a/tests/textfile/textfiletest.cpp +++ b/tests/textfile/textfiletest.cpp @@ -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