summaryrefslogtreecommitdiff
path: root/src/test/test-format-table.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/test-format-table.c')
-rw-r--r--src/test/test-format-table.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/test-format-table.c b/src/test/test-format-table.c
index 2527cacbb..f94cdf624 100644
--- a/src/test/test-format-table.c
+++ b/src/test/test-format-table.c
@@ -5,6 +5,9 @@
#include "string-util.h"
#include "time-util.h"
+/// Additional includes needed by elogind
+#include "locale-util.h"
+
static void test_issue_9549(void) {
_cleanup_(table_unrefp) Table *table = NULL;
_cleanup_free_ char *formatted = NULL;
@@ -74,6 +77,10 @@ int main(int argc, char *argv[]) {
table_set_width(t, 12);
assert_se(table_format(t, &formatted) >= 0);
+
+#if 1 /// elogind supports systems with non-UTF-8 locales, the next would fail there
+ if (is_locale_utf8()) {
+#endif // 1
printf("%s\n", formatted);
assert_se(streq(formatted,
@@ -104,6 +111,9 @@ int main(int argc, char *argv[]) {
"… … …\n"));
formatted = mfree(formatted);
+#if 1 /// elogind supports systems with non-UTF-8 locales, the previous would fail there
+ }
+#endif // 1
table_set_width(t, (size_t) -1);
assert_se(table_set_sort(t, (size_t) 0, (size_t) 2, (size_t) -1) >= 0);
@@ -120,6 +130,9 @@ int main(int argc, char *argv[]) {
table_set_header(t, false);
+#if 1 /// elogind supports systems with non-UTF-8 locales, the next would fail there
+ if (is_locale_utf8()) {
+#endif // 1
assert_se(table_add_many(t,
TABLE_STRING, "fäää",
TABLE_STRING, "uuu",
@@ -158,6 +171,9 @@ int main(int argc, char *argv[]) {
" yes fäää yes fäää fäää \n"
" yes xxx yes xxx xxx \n"
"5min 5min \n"));
+#if 1 /// elogind supports systems with non-UTF-8 locales, the previous would fail there
+ }
+#endif // 1
test_issue_9549();