From 5fd85d422fca0502f09c3017d4961bb17ccdc9b0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 28 Feb 2021 01:07:47 +0100 Subject: [PATCH] Add a trivial test for setting default locale Initializing wxLocale using wxLANGUAGE_DEFAULT should work, unless LC_ALL is explicitly set to an invalid value. --- tests/intl/intltest.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/intl/intltest.cpp b/tests/intl/intltest.cpp index a7e90e71bb..4c6b473b71 100644 --- a/tests/intl/intltest.cpp +++ b/tests/intl/intltest.cpp @@ -226,4 +226,11 @@ void IntlTestCase::IsAvailable() CPPUNIT_ASSERT_EQUAL( origLocale, setlocale(LC_ALL, NULL) ); } +TEST_CASE("wxLocale::Default", "[locale]") +{ + wxLocale loc; + + REQUIRE( loc.Init(wxLANGUAGE_DEFAULT, wxLOCALE_DONT_LOAD_DEFAULT) ); +} + #endif // wxUSE_INTL