+#if wxUSE_STD_STRING
+void StdStringTestCase::StdConversion()
+{
+ std::string strStd("std::string value");
+ wxStdWideString strStdWide(L"std::wstring value");
+
+ wxString s1(strStd);
+ CPPUNIT_ASSERT_EQUAL( "std::string value", s1 );
+
+ wxString s2(strStdWide);
+ CPPUNIT_ASSERT_EQUAL( "std::wstring value", s2 );
+
+ wxString s3;
+ s3 = strStd;
+ CPPUNIT_ASSERT_EQUAL( "std::string value", s3 );
+ s3 = strStdWide;
+ CPPUNIT_ASSERT_EQUAL( "std::wstring value", s3 );
+
+ 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_EQUAL( "hello", s5 );
+
+ wxStdWideString s6 = s4;
+ CPPUNIT_ASSERT_EQUAL( "hello", s6 );
+#endif
+
+ std::string s7(s4);
+ CPPUNIT_ASSERT( s7 == "hello" );
+
+ wxStdWideString s8(s4);
+ CPPUNIT_ASSERT( s8 == "hello" );
+}
+#endif // wxUSE_STD_STRING