Fix building tests with wxUSE_UNSAFE_WXSTRING_CONV==0
Avoid relying on implicit conversions to std::string in the tests code.
This commit is contained in:
@@ -1247,7 +1247,7 @@ void MBConvTestCase::TestStreamDecoder(
|
|||||||
{
|
{
|
||||||
wxChar wc = textInputStream.GetChar();
|
wxChar wc = textInputStream.GetChar();
|
||||||
CPPUNIT_ASSERT_EQUAL_MESSAGE(
|
CPPUNIT_ASSERT_EQUAL_MESSAGE(
|
||||||
std::string(wxString::Format("At position %lu", (unsigned long)i)),
|
wxString::Format("At position %lu", (unsigned long)i).ToStdString(),
|
||||||
wideBuffer[i],
|
wideBuffer[i],
|
||||||
wc
|
wc
|
||||||
);
|
);
|
||||||
|
@@ -607,8 +607,10 @@ void StdStringTestCase::StdConversion()
|
|||||||
#endif
|
#endif
|
||||||
CPPUNIT_ASSERT_EQUAL( "hello", s6 );
|
CPPUNIT_ASSERT_EQUAL( "hello", s6 );
|
||||||
|
|
||||||
|
#if wxUSE_UNSAFE_WXSTRING_CONV
|
||||||
std::string s7(s4);
|
std::string s7(s4);
|
||||||
CPPUNIT_ASSERT( s7 == "hello" );
|
CPPUNIT_ASSERT( s7 == "hello" );
|
||||||
|
#endif
|
||||||
|
|
||||||
wxStdWideString s8(s4);
|
wxStdWideString s8(s4);
|
||||||
CPPUNIT_ASSERT( s8 == "hello" );
|
CPPUNIT_ASSERT( s8 == "hello" );
|
||||||
|
@@ -1028,8 +1028,10 @@ void StringTestCase::CStrDataImplicitConversion()
|
|||||||
// implicit conversion of wxString is not available in STL build
|
// implicit conversion of wxString is not available in STL build
|
||||||
#if !wxUSE_STL
|
#if !wxUSE_STL
|
||||||
CPPUNIT_ASSERT( CheckStrConstWChar(s, s) );
|
CPPUNIT_ASSERT( CheckStrConstWChar(s, s) );
|
||||||
|
#if wxUSE_UNSAFE_WXSTRING_CONV
|
||||||
CPPUNIT_ASSERT( CheckStrConstChar(s, s) );
|
CPPUNIT_ASSERT( CheckStrConstChar(s, s) );
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void StringTestCase::ExplicitConversion()
|
void StringTestCase::ExplicitConversion()
|
||||||
|
@@ -113,7 +113,7 @@ private:
|
|||||||
static std::string
|
static std::string
|
||||||
Message(size_t n, const wxString& msg)
|
Message(size_t n, const wxString& msg)
|
||||||
{
|
{
|
||||||
return std::string(wxString::Format("#%lu: %s", (unsigned long)n, msg));
|
return wxString::Format("#%lu: %s", (unsigned long)n, msg).ToStdString();
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
Reference in New Issue
Block a user