summaryrefslogtreecommitdiff
path: root/src/test/test-string-util.c
diff options
context:
space:
mode:
authorSven Eden <yamakuzure@gmx.net>2017-08-14 09:16:16 +0200
committerSven Eden <yamakuzure@gmx.net>2017-08-14 09:20:58 +0200
commit7dee75c3e92339d219732cf4908e40380c31c0bf (patch)
treec1fb4503739ccbd93bfc2b9bd9a708cbc160c6ea /src/test/test-string-util.c
parentc8ef5e16e109c9082605e43e3ad0531dfb87a85c (diff)
Prep v235: Apply upstream fixes (9/10) [src/test]
Diffstat (limited to 'src/test/test-string-util.c')
-rw-r--r--src/test/test-string-util.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/test-string-util.c b/src/test/test-string-util.c
index 54fe87d2d..3938012d2 100644
--- a/src/test/test-string-util.c
+++ b/src/test/test-string-util.c
@@ -342,6 +342,12 @@ static void test_first_word(void) {
assert_se(!first_word("Hellooo", "Hello"));
}
+static void test_strlen_ptr(void) {
+ assert_se(strlen_ptr("foo") == 3);
+ assert_se(strlen_ptr("") == 0);
+ assert_se(strlen_ptr(NULL) == 0);
+}
+
int main(int argc, char *argv[]) {
test_string_erase();
#if 0 /// UNNEEDED by elogind
@@ -370,6 +376,7 @@ int main(int argc, char *argv[]) {
test_in_charset();
test_split_pair();
test_first_word();
+ test_strlen_ptr();
return 0;
}