diff options
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test-util.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/test/test-util.c b/src/test/test-util.c index dbc7cfe397..44921bd156 100644 --- a/src/test/test-util.c +++ b/src/test/test-util.c @@ -297,14 +297,16 @@ static void test_undecchar(void) { static void test_cescape(void) { _cleanup_free_ char *escaped; - escaped = cescape("abc\\\"\b\f\n\r\t\v\a\003\177\234\313"); + + assert_se(escaped = cescape("abc\\\"\b\f\n\r\t\v\a\003\177\234\313")); assert_se(streq(escaped, "abc\\\\\\\"\\b\\f\\n\\r\\t\\v\\a\\003\\177\\234\\313")); } static void test_cunescape(void) { _cleanup_free_ char *unescaped; - unescaped = cunescape("abc\\\\\\\"\\b\\f\\a\\n\\r\\t\\v\\003\\177\\234\\313"); - assert_se(streq(unescaped, "abc\\\"\b\f\a\n\r\t\v\003\177\234\313")); + + assert_se(unescaped = cunescape("abc\\\\\\\"\\b\\f\\a\\n\\r\\t\\v\\003\\177\\234\\313\\000\\x00")); + assert_se(streq(unescaped, "abc\\\"\b\f\a\n\r\t\v\003\177\234\313\\000\\x00")); } static void test_foreach_word(void) { |