diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2019-07-27 07:57:27 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2019-07-27 07:57:27 +0000 |
commit | d4a0bed4b91da9de86c311c7fef9a8aa9a6f500c (patch) | |
tree | a1b439049dee87bc951e190db93f5bbe8b43b0b5 /xserver/test/signal-logging.c | |
parent | b6bc775539a31f663f9e22ce3ccaf0aa96adf3b6 (diff) |
Update to xserver 1.20.5. Tested by jsg@
Diffstat (limited to 'xserver/test/signal-logging.c')
-rw-r--r-- | xserver/test/signal-logging.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/xserver/test/signal-logging.c b/xserver/test/signal-logging.c index 1af6316de..afbdeb241 100644 --- a/xserver/test/signal-logging.c +++ b/xserver/test/signal-logging.c @@ -30,6 +30,8 @@ #include "assert.h" #include "misc.h" +#include "tests-common.h" + struct number_format_test { uint64_t number; char string[21]; @@ -143,13 +145,13 @@ number_formatting(void) -0x7FFFFFFFFFFFFFFF, /* Maximum 64-bit signed number */ } ; - for (i = 0; i < sizeof(unsigned_tests) / sizeof(unsigned_tests[0]); i++) + for (i = 0; i < ARRAY_SIZE(unsigned_tests); i++) assert(check_number_format_test(unsigned_tests[i])); - for (i = 0; i < sizeof(signed_tests) / sizeof(signed_tests[0]); i++) + for (i = 0; i < ARRAY_SIZE(signed_tests); i++) assert(check_signed_number_format_test(signed_tests[i])); - for (i = 0; i < sizeof(float_tests) / sizeof(float_tests[0]); i++) + for (i = 0; i < ARRAY_SIZE(float_tests); i++) assert(check_float_format_test(float_tests[i])); } #pragma GCC diagnostic pop @@ -364,7 +366,7 @@ static void logging_format(void) } while(ptr); - for (i = 0; i < sizeof(float_tests)/sizeof(float_tests[0]); i++) { + for (i = 0; i < ARRAY_SIZE(float_tests); i++) { double d = float_tests[i]; char expected[30]; sprintf(expected, "(EE) %.2f\n", d); @@ -395,7 +397,7 @@ static void logging_format(void) #pragma GCC diagnostic pop /* "-Wformat-security" */ int -main(int argc, char **argv) +signal_logging_test(void) { number_formatting(); logging_format(); |