]> git.saurik.com Git - wxWidgets.git/blobdiff - tests/strings/crt.cpp
Use UTF16 for text data object on Mac. Fixes #10902
[wxWidgets.git] / tests / strings / crt.cpp
index 61dc5afcc6e05d403c1dfa45d1305ba2588ac779..e4e69caa1697fe2bd8a03d09afc8971be367704d 100644 (file)
@@ -69,15 +69,24 @@ CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( CrtTestCase, "CrtTestCase" );
 
 void CrtTestCase::SetGetEnv()
 {
+#define TESTVAR_NAME _T("WXTESTVAR")
+
     wxString val;
-    wxSetEnv(_T("TESTVAR"), _T("value"));
-    CPPUNIT_ASSERT( wxGetEnv(_T("TESTVAR"), &val) == true );
-    CPPUNIT_ASSERT( val == _T("value") );
-    wxSetEnv(_T("TESTVAR"), _T("something else"));
-    CPPUNIT_ASSERT( wxGetEnv(_T("TESTVAR"), &val) );
-    CPPUNIT_ASSERT( val == _T("something else") );
-    CPPUNIT_ASSERT( wxUnsetEnv(_T("TESTVAR")) );
-    CPPUNIT_ASSERT( wxGetEnv(_T("TESTVAR"), NULL) == false );
+    wxSetEnv(TESTVAR_NAME, _T("value"));
+    CPPUNIT_ASSERT( wxGetEnv(TESTVAR_NAME, &val) );
+    CPPUNIT_ASSERT_EQUAL( "value", val );
+    CPPUNIT_ASSERT_EQUAL( "value", wxString(wxGetenv(TESTVAR_NAME)) );
+
+    wxSetEnv(TESTVAR_NAME, _T("something else"));
+    CPPUNIT_ASSERT( wxGetEnv(TESTVAR_NAME, &val) );
+    CPPUNIT_ASSERT_EQUAL( "something else", val );
+    CPPUNIT_ASSERT_EQUAL( "something else", wxString(wxGetenv(TESTVAR_NAME)) );
+
+    CPPUNIT_ASSERT( wxUnsetEnv(TESTVAR_NAME) );
+    CPPUNIT_ASSERT( !wxGetEnv(TESTVAR_NAME, NULL) );
+    CPPUNIT_ASSERT( !wxGetenv(TESTVAR_NAME) );
+
+#undef TESTVAR_NAME
 }
 
 void CrtTestCase::Strcmp()