summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2019-02-28 19:19:06 -0500
committerJakob Kaivo <jkk@ung.org>2019-02-28 19:19:06 -0500
commit7eecacb007bf27e9ff31646a6e0a1d7bce51d4a7 (patch)
tree173545939a0ee7ed510a921eae0d352560c5ccf9
parent2c9367a4a7fc159c7622f6f8a026c5eed70f3e65 (diff)
use distinct value test
-rw-r--r--locale.c36
1 files changed, 13 insertions, 23 deletions
diff --git a/locale.c b/locale.c
index b6d48ed..b1ab618 100644
--- a/locale.c
+++ b/locale.c
@@ -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() */