aboutsummaryrefslogtreecommitdiffstats
path: root/tests/serd_test.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-08-14 16:21:27 +0200
committerDavid Robillard <d@drobilla.net>2020-08-14 19:07:52 +0200
commit4103d14a3a17fe34303d5078c480c43f4e9143a5 (patch)
tree26b885c5cf0ee76e8ae48f415c9d2e91c9b44700 /tests/serd_test.c
parenta9a6a4e417189b53ee559278be5d242986120422 (diff)
downloadserd-4103d14a3a17fe34303d5078c480c43f4e9143a5.tar.gz
serd-4103d14a3a17fe34303d5078c480c43f4e9143a5.tar.bz2
serd-4103d14a3a17fe34303d5078c480c43f4e9143a5.zip
Add test for serd_strerror with unknown errors
Diffstat (limited to 'tests/serd_test.c')
-rw-r--r--tests/serd_test.c9
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