correct some compatibility problems with the existing Unicode-mode code (#9513), more remains to be done (#9560)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54060 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-06-09 22:50:55 +00:00
parent c1bc8d9f92
commit 425eee4164
2 changed files with 52 additions and 16 deletions

View File

@@ -684,6 +684,31 @@ void DateTimeTestCase::TestTimeFormat()
}
}
}
// test compilation of some calls which should compile (and not result in
// ambiguity because of char*<->wxCStrData<->wxString conversions)
wxDateTime dt;
wxString s("foo");
CPPUNIT_ASSERT( !dt.ParseFormat("foo") );
CPPUNIT_ASSERT( !dt.ParseFormat(wxT("foo")) );
CPPUNIT_ASSERT( !dt.ParseFormat(s) );
CPPUNIT_ASSERT( !dt.ParseFormat(s.c_str()) );
CPPUNIT_ASSERT( !dt.ParseFormat("foo", "%c") );
CPPUNIT_ASSERT( !dt.ParseFormat(wxT("foo"), "%c") );
CPPUNIT_ASSERT( !dt.ParseFormat(s, "%c") );
CPPUNIT_ASSERT( !dt.ParseFormat(s.c_str(), "%c") );
CPPUNIT_ASSERT( !dt.ParseFormat("foo", wxT("%c")) );
CPPUNIT_ASSERT( !dt.ParseFormat(wxT("foo"), wxT("%c")) );
CPPUNIT_ASSERT( !dt.ParseFormat(s, "%c") );
CPPUNIT_ASSERT( !dt.ParseFormat(s.c_str(), wxT("%c")) );
wxString spec("%c");
CPPUNIT_ASSERT( !dt.ParseFormat("foo", spec) );
CPPUNIT_ASSERT( !dt.ParseFormat(wxT("foo"), spec) );
CPPUNIT_ASSERT( !dt.ParseFormat(s, spec) );
CPPUNIT_ASSERT( !dt.ParseFormat(s.c_str(), spec) );
}
void DateTimeTestCase::TestTimeSpanFormat()