From 7eecacb007bf27e9ff31646a6e0a1d7bce51d4a7 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Thu, 28 Feb 2019 19:19:06 -0500 Subject: use distinct value test --- locale.c | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-) (limited to 'locale.c') diff --git a/locale.c b/locale.c index b6d48ed..b1ab618 100644 --- a/locale.c +++ b/locale.c @@ -2,12 +2,6 @@ #include #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() */ -- cgit v1.2.1