+#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");
+
+ // notice that implicit 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;
+#else
+ std::string s5 = s4.ToStdString();
+#endif
+ CPPUNIT_ASSERT_EQUAL( "hello", s5 );
+
+#if wxUSE_STL
+ wxStdWideString s6 = s4;
+#else
+ wxStdWideString s6 = s4.ToStdWstring();
+#endif
+ CPPUNIT_ASSERT_EQUAL( "hello", s6 );
+
+ std::string s7(s4);
+ CPPUNIT_ASSERT( s7 == "hello" );
+
+ wxStdWideString s8(s4);
+ CPPUNIT_ASSERT( s8 == "hello" );
+}
+#endif // wxUSE_STD_STRING