summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-08-13 11:15:54 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-08-21 07:54:07 +1000
commitb69536b475118a8787c1726355b504207bf83f8f (patch)
treeab4eeb4605c1412939812654a08fc2e01b759c9c
parent02f94b2d446f6700f791f318c551ac835af8445a (diff)
test: assert from signal-safe number conversion
Throw an assert when the conversion fails instead of just returning. Asserts are more informative. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
-rw-r--r--test/signal-logging.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/test/signal-logging.c b/test/signal-logging.c
index 8aab0dd58..646715033 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;
}