From 831ebad3855c21d03a96cab1b887958ffca6267a Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 24 Feb 2019 19:19:11 +0100 Subject: Add test for serd_strerror with unknown errors --- tests/serd_test.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/serd_test.c b/tests/serd_test.c index 05f49b60..bcf464e2 100644 --- a/tests/serd_test.c +++ b/tests/serd_test.c @@ -373,13 +373,14 @@ test_strlen(void) static void test_strerror(void) { - const char* msg = NULL; - assert(!strcmp((msg = serd_strerror(SERD_SUCCESS)), "Success")); + const char* msg = serd_strerror(SERD_SUCCESS); + assert(!strcmp(msg, "Success")); for (int i = SERD_FAILURE; i <= SERD_ERR_NO_DATA; ++i) { msg = serd_strerror((SerdStatus)i); assert(strcmp(msg, "Success")); } msg = serd_strerror((SerdStatus)-1); + assert(!strcmp(msg, "Unknown error")); } static void -- cgit v1.2.1