make sure passing a null state to append_test_log() doesn't crash it

This commit is contained in:
jlamothe 2023-11-14 20:16:30 +00:00
parent 2a092d1050
commit bcfd584608

View File

@ -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)
{