diff options
author | David Robillard <d@drobilla.net> | 2020-08-14 16:21:27 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-08-14 19:07:52 +0200 |
commit | 4103d14a3a17fe34303d5078c480c43f4e9143a5 (patch) | |
tree | 26b885c5cf0ee76e8ae48f415c9d2e91c9b44700 | |
parent | a9a6a4e417189b53ee559278be5d242986120422 (diff) | |
download | serd-4103d14a3a17fe34303d5078c480c43f4e9143a5.tar.gz serd-4103d14a3a17fe34303d5078c480c43f4e9143a5.tar.bz2 serd-4103d14a3a17fe34303d5078c480c43f4e9143a5.zip |
Add test for serd_strerror with unknown errors
-rw-r--r-- | tests/serd_test.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/serd_test.c b/tests/serd_test.c index 2bf249b7..fbc42bcd 100644 --- a/tests/serd_test.c +++ b/tests/serd_test.c @@ -288,12 +288,15 @@ test_strlen(void) static void test_strerror(void) { - assert(!strcmp((const char*)(serd_strerror(SERD_SUCCESS)), "Success")); + const uint8_t* msg = serd_strerror(SERD_SUCCESS); + assert(!strcmp((const char*)msg, "Success")); for (int i = SERD_FAILURE; i <= SERD_ERR_INTERNAL; ++i) { - const uint8_t* const msg = serd_strerror((SerdStatus)i); + msg = serd_strerror((SerdStatus)i); assert(strcmp((const char*)msg, "Success")); } - serd_strerror((SerdStatus)-1); + + msg = serd_strerror((SerdStatus)-1); + assert(!strcmp((const char*)msg, "Unknown error")); } static void |