Skip to content

Commit

Permalink
Better error when Encoder test fails for lack of French locale
Browse files Browse the repository at this point in the history
  • Loading branch information
snej committed Sep 20, 2024
1 parent 37c0b0c commit 6aa9014
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Tests/EncoderTests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1076,11 +1076,12 @@ class EncoderTests {
CHECK(ParseDouble(floatBuf, recovered));
CHECK(FloatEquals(float(recovered), 2.71828f));

const char* localeName = "fr_FR";
#ifdef _MSC_VER
setlocale(LC_ALL, "fr-FR");
#else
setlocale(LC_ALL, "fr_FR");
localeName = "fr-FR";
#endif
if(setlocale(LC_ALL, localeName) == nullptr)
FAIL("Zut alors! No French locale installed!");

snprintf(doubleBuf, doubleBufSize, "%.16g", testDouble);
snprintf(floatBuf, floatBufSize, "%.7g", testFloat);
Expand Down

0 comments on commit 6aa9014

Please sign in to comment.