// are not very important, we're testing if the code compiles at all):
wxString s("foo");
- const char *mbStr = "foo";
- const wchar_t *wcStr = L"foo";
// FIXME-UTF8: when wxCStrData can handle both conversions, this should
// be changed to always test all versions, both MB and WC
#if wxUSE_UNICODE
+ const wchar_t *wcStr = L"foo";
CPPUNIT_ASSERT( CheckStr(s, (cond ? s.c_str() : wcStr)) );
CPPUNIT_ASSERT( CheckStr(s, (cond ? s.c_str() : L"bar")) );
CPPUNIT_ASSERT( CheckStr(s, (cond ? wcStr : s.c_str())) );
CPPUNIT_ASSERT( CheckStr(s, (cond ? L"bar" : s.c_str())) );
#else
+ const char *mbStr = "foo";
CPPUNIT_ASSERT( CheckStr(s, (cond ? s.c_str() : mbStr)) );
CPPUNIT_ASSERT( CheckStr(s, (cond ? s.c_str() : "foo")) );
CPPUNIT_ASSERT( CheckStr(s, (cond ? mbStr : s.c_str())) );
CPPUNIT_ASSERT( CheckStr(s, (cond ? "foo" : s.c_str())) );
#endif
+
+ wxString empty("");
+ CPPUNIT_ASSERT( CheckStr(empty, (cond ? empty.c_str() : wxEmptyString)) );
+ CPPUNIT_ASSERT( CheckStr(empty, (cond ? wxEmptyString : empty.c_str())) );
}
bool CheckStrChar(const wxString& expected, char *s)