chiark / gitweb /
Prep v239: Unmask delete_chars()
[elogind.git] / src / test / test-string-util.c
index 4ff792c4c05c416335f8dcc20965e95b92daba6d..202af8bcc3356e327c5db1f01f8577b1b29824de 100644 (file)
@@ -1,15 +1,11 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
-/***
-  This file is part of systemd.
-
-  Copyright 2015 Lennart Poettering
-***/
 
 #include "alloc-util.h"
-//#include "locale-util.h"
+#include "locale-util.h"
 #include "macro.h"
 #include "string-util.h"
 #include "strv.h"
+#include "utf8.h"
 
 static void test_string_erase(void) {
         char *x;
@@ -388,7 +384,6 @@ static void test_endswith_no_case(void) {
         assert_se(!endswith_no_case("foobar", "FOOBARFOOFOO"));
 }
 
-#if 0 /// UNNEEDED by elogind
 static void test_delete_chars(void) {
         char *s, input[] = "   hello, waldo.   abc";
 
@@ -396,7 +391,6 @@ static void test_delete_chars(void) {
         assert_se(streq(s, "hello,waldo.abc"));
         assert_se(s == input);
 }
-#endif // 0
 
 static void test_delete_trailing_chars(void) {
 
@@ -435,7 +429,6 @@ static void test_delete_trailing_slashes(void) {
         assert_se(streq(delete_trailing_chars(s4, "/"), ""));
 }
 
-#if 0 /// UNNEEDED by elogind
 static void test_skip_leading_chars(void) {
         char input1[] = " \n \r k \n \r ",
                 input2[] = "kkkkthiskkkiskkkaktestkkk",
@@ -447,7 +440,6 @@ static void test_skip_leading_chars(void) {
         assert_se(streq(skip_leading_chars(input3, WHITESPACE), "abcdef"));
         assert_se(streq(skip_leading_chars(input3, "bcaef"), "def"));
 }
-#endif // 0
 
 static void test_in_charset(void) {
         assert_se(in_charset("dddaaabbbcccc", "abcd"));
@@ -532,14 +524,10 @@ int main(int argc, char *argv[]) {
         test_foreach_word_quoted();
         test_endswith();
         test_endswith_no_case();
-#if 0 /// UNNEEDED by elogind
         test_delete_chars();
-#endif // 0
         test_delete_trailing_chars();
         test_delete_trailing_slashes();
-#if 0 /// UNNEEDED by elogind
         test_skip_leading_chars();
-#endif // 0
         test_in_charset();
         test_split_pair();
         test_first_word();