HomeWildfire Games

Fix cppformat failures on MacOS tests.

Description

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

Event Timeline

elexis added a subscriber: elexis.Jun 25 2019, 10:59 PM
elexis added inline comments.
/ps/trunk/source/ps/tests/test_CStr.h
142

(same)

/ps/trunk/source/ps/tests/test_cppformat.h
61

The idea of this call is to restore the locale that was set before entering the function?

wraitii added inline comments.Jun 25 2019, 11:02 PM
/ps/trunk/source/ps/tests/test_cppformat.h
61

Yes, to avoid changing the global state (not necessarily thread-safely though...)

elexis added inline comments.Jun 25 2019, 11:03 PM
/ps/trunk/source/ps/tests/test_cppformat.h
61

so char* old = setlocale(LC_ALL, "en_US.UTF-8"); returns the locale before or after applying the change passed in the arguments?

wraitii added inline comments.Jun 25 2019, 11:08 PM
/ps/trunk/source/ps/tests/test_cppformat.h
61

-_- I suggested that here and I did check here, but I obviously got that wrong and didn't check further.

elexis raised a concern with this commit.Jun 25 2019, 11:27 PM

(see above)

This commit now has outstanding concerns.Jun 25 2019, 11:27 PM
Stan removed an auditor: elexis.Dec 23 2020, 11:54 PM
Stan added a subscriber: Stan.

AFAIK this is now fixed by using the C locale. Will be irrelevant when switching to C++20

This commit no longer requires audit.Dec 23 2020, 11:54 PM