From 21b7c2d4086262fcc5a0c46fc0e4679b5d9fcd6f Mon Sep 17 00:00:00 2001 From: Jakub Filak Date: Fri, 4 Apr 2014 11:30:13 +0200 Subject: [LIBREPORT PATCH 41/93] testsuite: check return value of setlocale() If setlocale() fails to set the desired locale value, the test results look like a bug appeared in libreport. Related to rhbz#1070892 Signed-off-by: Jakub Filak --- tests/xml_definition.at | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/xml_definition.at b/tests/xml_definition.at index d3032c9..29043f8 100644 --- a/tests/xml_definition.at +++ b/tests/xml_definition.at @@ -18,7 +18,7 @@ int main(void) { g_verbose = 3; - setlocale(LC_ALL, "zh_CN"); + assert(setlocale(LC_ALL, "zh_CN") != NULL || !"setlocale() failed"); { event_config_t *event_config = new_event_config("event_test_definition"); @@ -55,7 +55,7 @@ int main(void) free_workflow(workflow); } - setlocale(LC_ALL, "zh_CN.utf8"); + assert(setlocale(LC_ALL, "zh_CN.utf8") != NULL || !"setlocale() failed"); { event_config_t *event_config = new_event_config("event_test_definition"); @@ -97,7 +97,7 @@ int main(void) for zh_CN and followed by zh_TW. libreport should you string for zh_TW and these strings are prefixed with "bad " string. */ - setlocale(LC_ALL, "zh_HK"); + assert(setlocale(LC_ALL, "zh_HK") != NULL || !"setlocale() failed"); { event_config_t *event_config = new_event_config("event_test_definition"); -- 1.8.3.1