From 1aa5c5fcc55f65bb48396a6fb45af060eb24b8e6 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 22 Feb 2025 00:54:23 +0100 Subject: m fix + add tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- liblog_destroy_context.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'liblog_destroy_context.c') diff --git a/liblog_destroy_context.c b/liblog_destroy_context.c index 57192ac..6a3fa09 100644 --- a/liblog_destroy_context.c +++ b/liblog_destroy_context.c @@ -27,6 +27,20 @@ liblog_destroy_context(struct liblog_context *ctx) #else -int main(void) {return 0;} /* TODO test */ +int +main(void) +{ + struct liblog_context ctx; + char *nullenv[] = {NULL}; + + environ = nullenv; + + ASSERT_ZERO(liblog_destroy_context(NULL)); + + ASSERT_ZERO(liblog_init_context(&ctx)); + ASSERT_ZERO(liblog_destroy_context(&ctx)); + + return 0; +} #endif -- cgit v1.2.3-70-g09d2