Fix cppformat failures on MacOS tests.
cppformat tests failed on MacOS - the global locale was not set and defaulted to something unexcpeted. It is now fixed to US notation. Patch By: Krinkle Reviewed By: wraitii Differential Revision: https://code.wildfiregames.com/D1978 This was SVN commit r22378.
This commit is contained in:
parent
9e8a43401e
commit
61db02790c
@ -113,8 +113,7 @@ public:
|
||||
// because GTK+ can change the locale when we're running Atlas.
|
||||
// (If the host system doesn't have the locale we're using for this test
|
||||
// then it'll just stick with the default, which is fine)
|
||||
char* old = setlocale(LC_NUMERIC, NULL);
|
||||
setlocale(LC_NUMERIC, "fr_FR.UTF-8");
|
||||
char* old = setlocale(LC_NUMERIC, "fr_FR.UTF-8");
|
||||
|
||||
CStr8 str1("1.234");
|
||||
TS_ASSERT_DELTA(str1.ToFloat(), 1.234f, 0.0001f);
|
||||
|
@ -24,6 +24,9 @@ class TestCppformat : public CxxTest::TestSuite
|
||||
public:
|
||||
void test_basic()
|
||||
{
|
||||
// Make test behave independent of current host locale
|
||||
char* old = setlocale(LC_ALL, "en_US.UTF-8");
|
||||
|
||||
TS_ASSERT_EQUALS(fmt::sprintf("abc"), "abc");
|
||||
|
||||
TS_ASSERT_EQUALS(fmt::sprintf("%d", 123), "123");
|
||||
@ -54,5 +57,7 @@ public:
|
||||
TS_ASSERT_EQUALS(fmt::sprintf("T%sT", (const char*)NULL), "T(null)T");
|
||||
|
||||
TS_ASSERT_EQUALS(fmt::sprintf("T%pT", (void*)0x1234), "T0x1234T");
|
||||
|
||||
setlocale(LC_ALL, old);
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user