diff options
-rw-r--r-- | string/test-ffs.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/string/test-ffs.c b/string/test-ffs.c index e5e7579..d78d638 100644 --- a/string/test-ffs.c +++ b/string/test-ffs.c @@ -21,27 +21,26 @@ #include <stdio.h> #include <string.h> +int failures = 0; + +void +try (const char *name, long long int param, int value, int expected) +{ + if (value != expected) + { + printf ("%s(%#llx) expected %d got %d\n", + name, param, expected, value); + ++failures; + } + else + printf ("%s(%#llx) as expected %d\n", name, param, value); +} + int do_test (void) { - int failures = 0; int i; - auto void try (const char *name, long long int param, int value, - int expected); - - void try (const char *name, long long int param, int value, int expected) - { - if (value != expected) - { - printf ("%s(%#llx) expected %d got %d\n", - name, param, expected, value); - ++failures; - } - else - printf ("%s(%#llx) as expected %d\n", name, param, value); - } - #define TEST(fct, type) \ try (#fct, 0, fct ((type) 0), 0); \ for (i=0 ; i < 8 * sizeof (type); i++) \ |