Skip to content
Commit a0c7f854 authored by Ting-Wei Lan's avatar Ting-Wei Lan Committed by Philip Withnall
Browse files

tests: Fix GDateTime format tests on non-English locales

It seems that the test expects g_date_time_format to return formatted
results in English, and there is no setlocale (LC_ALL, "") call in the
file so the test does run in the default C locale. However, gettext
seems to read the value of LC_MESSAGES from the environment by itself.
Even if the value of LC_MESSAGES locale is C because of not calling
setlocale, gettext still translates the name of the month according to
the LC_MESSAGES environment variable, causing g_date_time_format_locale
to fail on the "%b" test case because it cannot convert UTF-8 text
returned by get_month_name_with_day to ASCII.

To avoid the test failure, we set the LC_MESSAGES environment variable
to C before format tests and restore it at the end of the function.

https://bugzilla.gnome.org/show_bug.cgi?id=795165
parent c47cf735
Pipeline #10304 failed with stage
in 3 minutes and 28 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment