[PATCH 1/5] test: assert from signal-safe number conversion

Peter Hutterer peter.hutterer at who-t.net
Wed Aug 15 21:52:45 PDT 2012


Throw an assert when the conversion fails instead of just returning. Asserts
are more informative.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 test/signal-logging.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/test/signal-logging.c b/test/signal-logging.c
index 8aab0dd..6467150 100644
--- a/test/signal-logging.c
+++ b/test/signal-logging.c
@@ -57,7 +57,7 @@ check_number_format_test(const struct number_format_test *test)
     return TRUE;
 }
 
-static Bool
+static void
 number_formatting(void)
 {
     int i;
@@ -100,16 +100,14 @@ number_formatting(void)
     };
 
     for (i = 0; i < sizeof(tests) / sizeof(tests[0]); i++)
-        if (!check_number_format_test(tests + i))
-            return FALSE;
+        assert(check_number_format_test(tests + i));
 
-    return TRUE;
 }
 
 int
 main(int argc, char **argv)
 {
-    int ok = number_formatting();
+    number_formatting();
 
-    return ok ? 0 : 1;
+    return 0;
 }
-- 
1.7.11.2



More information about the xorg-devel mailing list