diff options
author | David Robillard <d@drobilla.net> | 2019-02-24 19:19:11 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-12-20 10:26:55 -0500 |
commit | 831ebad3855c21d03a96cab1b887958ffca6267a (patch) | |
tree | adb516b4758c3bf2ea663f0352810ceb504f6ebb | |
parent | 12b217de575a35a05e8a09fd7403f7e9852f8485 (diff) | |
download | serd-831ebad3855c21d03a96cab1b887958ffca6267a.tar.gz serd-831ebad3855c21d03a96cab1b887958ffca6267a.tar.bz2 serd-831ebad3855c21d03a96cab1b887958ffca6267a.zip |
Add test for serd_strerror with unknown errors
-rw-r--r-- | tests/serd_test.c | 5 |
1 files 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 |