Blame SOURCES/0041-testsuite-check-return-value-of-setlocale.patch

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