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

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