Add '\0'-related stdout redirection tests
[platform/core/system/dlog.git] / tests / dlog_test.in
index 0880400..aa07947 100644 (file)
@@ -930,6 +930,18 @@ EOF
        [ "$(dlogutil -db main | wc -l)" -eq 5 ] && ok || fail
        dlogutil -cb main
 
+       dlog_redirect_stdout --outtag QUUX -- /usr/bin/sh -c "printf \"line 1\0line 2\0line 3\0line 4\0line 5\""
+       sleep 1
+       LOG_DETAILS="testing if logs with the '\\0' character are handled correctly"
+       [ "$(dlogutil -db main | wc -l)" -eq 5 ] && ok || fail
+       dlogutil -cb main
+
+       dlog_redirect_stdout --outtag QUUX -- /usr/bin/sh -c "printf \"line 1\0line 2\nline 3\0line 4\nline 5\""
+       sleep 1
+       LOG_DETAILS="testing if logs with mixed delimiters are handled correctly"
+       [ "$(dlogutil -db main | wc -l)" -eq 5 ] && ok || fail
+       dlogutil -cb main
+
        rm -f "$TESTDIR"/input
        rm -f "$TESTDIR"/output
        base64 -w 0 < /dev/urandom 2> /dev/null | head -c 250000 > "$TESTDIR"/input