- wxString result = wxConvertFormat(input);
- wxString msg = _T("input: '") + input +
- _T("', result: '") + result +
- _T("', expected: '") + expected + _T("'");
- CPPUNIT_ASSERT_MESSAGE(string(msg.mb_str()), result == expected);
+ // all of them are unused in some build configurations
+ wxUnusedVar(expectedScanf);
+ wxUnusedVar(expectedUtf8);
+ wxUnusedVar(expectedWcharUnix);
+ wxUnusedVar(expectedWcharWindows);
+
+ wxString result, msg;
+
+#ifndef __WINDOWS__
+ // on windows, wxScanf() string needs no modifications
+ result = wxScanfConvertFormatW(input.wc_str());
+
+ msg = wxT("input: '") + input +
+ wxT("', result (scanf): '") + result +
+ wxT("', expected: '") + expectedScanf + wxT("'");
+ CPPUNIT_ASSERT_MESSAGE(string(msg.mb_str()), result == expectedScanf);
+#endif // !__WINDOWS__
+
+#if wxUSE_UNICODE_UTF8
+ result = (const char*)wxFormatString(input);
+
+ msg = wxT("input: '") + input +
+ wxT("', result (UTF-8): '") + result +
+ wxT("', expected: '") + expectedUtf8 + wxT("'");
+ CPPUNIT_ASSERT_MESSAGE(string(msg.mb_str()), result == expectedUtf8);
+#endif // wxUSE_UNICODE_UTF8
+
+#if wxUSE_UNICODE && !wxUSE_UTF8_LOCALE_ONLY
+ result = (const wchar_t*)wxFormatString(input);
+
+#ifdef __WINDOWS__
+ wxString expectedWchar(expectedWcharWindows);
+#else
+ wxString expectedWchar(expectedWcharUnix);
+#endif
+
+ msg = wxT("input: '") + input +
+ wxT("', result (wchar_t): '") + result +
+ wxT("', expected: '") + expectedWchar + wxT("'");
+ CPPUNIT_ASSERT_MESSAGE(string(msg.mb_str()), result == expectedWchar);
+#endif // wxUSE_UNICODE && !wxUSE_UTF8_LOCALE_ONLY