summaryrefslogtreecommitdiff
path: root/src/test/test-locale-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/test-locale-util.c')
-rw-r--r--src/test/test-locale-util.c45
1 files changed, 25 insertions, 20 deletions
diff --git a/src/test/test-locale-util.c b/src/test/test-locale-util.c
index 4467bdd48d..8ffae8ca03 100644
--- a/src/test/test-locale-util.c
+++ b/src/test/test-locale-util.c
@@ -1,23 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
-/***
- This file is part of systemd
-
- Copyright 2014 Ronny Chevalier
-
- systemd is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 of the License, or
- (at your option) any later version.
-
- systemd is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with systemd; If not, see <http://www.gnu.org/licenses/>.
-***/
-
#include "locale-util.h"
#include "macro.h"
@@ -39,6 +20,8 @@ static void test_get_locales(void) {
}
static void test_locale_is_valid(void) {
+ log_info("/* %s */", __func__);
+
assert_se(locale_is_valid("en_EN.utf8"));
assert_se(locale_is_valid("fr_FR.utf8"));
assert_se(locale_is_valid("fr_FR@euro"));
@@ -56,6 +39,8 @@ static void test_keymaps(void) {
char **p;
int r;
+ log_info("/* %s */", __func__);
+
assert_se(!keymap_is_valid(""));
assert_se(!keymap_is_valid("/usr/bin/foo"));
assert_se(!keymap_is_valid("\x01gar\x02 bage\x03"));
@@ -78,11 +63,31 @@ static void test_keymaps(void) {
assert_se(keymap_is_valid("unicode"));
}
+#define dump_glyph(x) log_info(STRINGIFY(x) ": %s", special_glyph(x))
+static void dump_special_glyphs(void) {
+ assert_cc(ELLIPSIS + 1 == _SPECIAL_GLYPH_MAX);
+
+ log_info("/* %s */", __func__);
+
+ log_info("is_locale_utf8: %s", yes_no(is_locale_utf8()));
+
+ dump_glyph(TREE_VERTICAL);
+ dump_glyph(TREE_BRANCH);
+ dump_glyph(TREE_RIGHT);
+ dump_glyph(TREE_SPACE);
+ dump_glyph(TRIANGULAR_BULLET);
+ dump_glyph(BLACK_CIRCLE);
+ dump_glyph(ARROW);
+ dump_glyph(MDASH);
+ dump_glyph(ELLIPSIS);
+}
+
int main(int argc, char *argv[]) {
test_get_locales();
test_locale_is_valid();
-
test_keymaps();
+ dump_special_glyphs();
+
return 0;
}