diff options
author | Jakob Kaivo <jkk@ung.org> | 2019-02-28 19:19:06 -0500 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2019-02-28 19:19:06 -0500 |
commit | 7eecacb007bf27e9ff31646a6e0a1d7bce51d4a7 (patch) | |
tree | 173545939a0ee7ed510a921eae0d352560c5ccf9 | |
parent | 2c9367a4a7fc159c7622f6f8a026c5eed70f3e65 (diff) |
use distinct value test
-rw-r--r-- | locale.c | 36 |
1 files changed, 13 insertions, 23 deletions
@@ -2,12 +2,6 @@ #include <limits.h> #include "test.h" -void test_locale(void) -{ - struct lconv *lc; - - testing_header("locale.h"); - #ifndef LC_ALL #error LC_ALL not defined #endif @@ -32,25 +26,21 @@ void test_locale(void) #error LC_TIME not defined #endif - test_true(LC_ALL != LC_COLLATE); - test_true(LC_ALL != LC_CTYPE); - test_true(LC_ALL != LC_MONETARY); - test_true(LC_ALL != LC_NUMERIC); - test_true(LC_ALL != LC_TIME); - - test_true(LC_COLLATE != LC_CTYPE); - test_true(LC_COLLATE != LC_MONETARY); - test_true(LC_COLLATE != LC_NUMERIC); - test_true(LC_COLLATE != LC_TIME); - - test_true(LC_CTYPE != LC_MONETARY); - test_true(LC_CTYPE != LC_NUMERIC); - test_true(LC_CTYPE != LC_TIME); +void test_locale(void) +{ + struct lconv *lc; + int locale_categories[] = { + LC_ALL, + LC_COLLATE, + LC_CTYPE, + LC_MONETARY, + LC_NUMERIC, + LC_TIME, + }; - test_true(LC_MONETARY != LC_NUMERIC); - test_true(LC_MONETARY != LC_TIME); + testing_header("locale.h"); - test_true(LC_NUMERIC != LC_TIME); + test_distinct(locale_categories); /* TODO: test setlocale() */ |