+#if wxUSE_STD_STRING
+void StdStringTestCase::StdConversion()
+{
+ std::string strStd("std::string value");
+ wxStdWideString strStdWide(L"std::wstring value");
+
+ wxString s1(strStd);
+ CPPUNIT_ASSERT( s1 == "std::string value" );
+
+ wxString s2(strStdWide);
+ CPPUNIT_ASSERT( s2 == "std::wstring value" );
+
+ wxString s3;
+ s3 = strStd;
+ CPPUNIT_ASSERT( s3 == "std::string value" );
+ s3 = strStdWide;
+ CPPUNIT_ASSERT( s3 == "std::wstring value" );
+
+ wxString s4("hello");
+
+ // wxString -> std::string conversion is only available in wxUSE_STL case,
+ // because it conflicts with conversion to const char*/wchar_t*:
+#if wxUSE_STL
+ std::string s5 = s4;
+ CPPUNIT_ASSERT( s5 == "hello" );
+
+ wxStdWideString s6 = s4;
+ CPPUNIT_ASSERT( s6 == "hello" );
+#endif
+
+ std::string s7(s4);
+ CPPUNIT_ASSERT( s7 == "hello" );
+
+ wxStdWideString s8(s4);
+ CPPUNIT_ASSERT( s8 == "hello" );
+}
+#endif // wxUSE_STD_STRING