After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 669285 - glib/tests/markup-parse fails under non-english locale
glib/tests/markup-parse fails under non-english locale
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2012-02-02 23:24 UTC by Christian Persch
Modified: 2012-04-13 13:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Make the markup-parse test independent of the locale (960 bytes, patch)
2012-04-13 13:44 UTC, Matthias Clasen
committed Details | Review

Description Christian Persch 2012-02-02 23:24:36 UTC
/markup/parse/fail-15.gmarkup: **
ERROR:markup-parse.c:268:test_parse: assertion failed (string->str == expected): ("ELEMENT 'foo'\n  TEXT '\n'\n  ELEMENT 'bar'\n    TEXT '\n'\n  END 'bar'\nERROR Fehler in Zeile 3, Zeichen 8: Dokument endete unerwartet mit noch offenen Elementen - \302\273foo\302\253 war das letzte offene Element\n" == "ELEMENT 'foo'\n  TEXT '\n'\n  ELEMENT 'bar'\n    TEXT '\n'\n  END 'bar'\nERROR Error on line 3 char 8: Document ended unexpectedly with elements still open - 'foo' was the last element opened\n")

Due to commit 08e17ae51b6336d059b0cc85071cc26772ab2f0c. Now this one's commit msg says that it's necessary to call setlocale... but if that's true shouldn't the testcase make sure to use an english locale, so that strcmp on error msgs works? Or, if we don't support running the test suite under non-english locale, the makefile should ensure this by setting LANG or LC_ALL for make check.

I guess this problem may exist for some other tests, too.
Comment 1 Kjartan Maraas 2012-04-12 12:01:23 UTC
I see this in glib/tests/date.c and glib/tests/markup-parse.c

I guess there's also the possibility of marking the strings in the test cases for translation, but that depends on having a fully translated module to work I guess.
Comment 2 Matthias Clasen 2012-04-13 13:44:54 UTC
The following fix has been pushed:
50aed1c Make the markup-parse test independent of the locale
Comment 3 Matthias Clasen 2012-04-13 13:44:58 UTC
Created attachment 211994 [details] [review]
Make the markup-parse test independent of the locale

I added a setlocale call, because we need it for Unicode to
come out right; but I forgot to fix the locale, so we now
fail when comparing error messages to the expected (English)
result. Correct this by setting LANG explicitly to en_US.utf-8.