From bcfd584608202b7759532f9eb35743bf1337b582 Mon Sep 17 00:00:00 2001 From: jlamothe Date: Tue, 14 Nov 2023 20:16:30 +0000 Subject: [PATCH] make sure passing a null state to append_test_log() doesn't crash it --- test/append-test-log.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/append-test-log.c b/test/append-test-log.c index 213c9f0..860100b 100644 --- a/test/append-test-log.c +++ b/test/append-test-log.c @@ -44,6 +44,7 @@ static void append_to_existing(TestState *); static void missing_last(TestState *); static void missing_first(TestState *); static void null_message(TestState *); +decl_test(null_state); static void chk_last(TestState *, LogData *, const char *); static void mk_log_data(LogData *); @@ -66,6 +67,7 @@ test_append_test_log(TestState *s) missing_last(s); missing_first(s); null_message(s); + run_test(s, null_state); } // Local Functions @@ -210,6 +212,12 @@ null_message(TestState *s) ); } +decl_test(null_state) +{ + append_test_log(0, "foo"); + return test_success; +} + static void chk_last(TestState *s, LogData *ld, const char *context) {