aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-02-24 19:19:11 +0100
committerDavid Robillard <d@drobilla.net>2019-04-13 19:48:23 +0200
commit16d4ccf422f8e470bf4bdc9458047831b0dc7116 (patch)
tree6510f04690492da87f5f1d399309a5756f784842
parent65fbd3c8e9cbe78d1a342acd442019a010b058c2 (diff)
downloadserd-16d4ccf422f8e470bf4bdc9458047831b0dc7116.tar.gz
serd-16d4ccf422f8e470bf4bdc9458047831b0dc7116.tar.bz2
serd-16d4ccf422f8e470bf4bdc9458047831b0dc7116.zip
Add test for serd_strerror with unknown errors
-rw-r--r--tests/serd_test.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/serd_test.c b/tests/serd_test.c
index d3a8f514..04dbeb01 100644
--- a/tests/serd_test.c
+++ b/tests/serd_test.c
@@ -299,13 +299,14 @@ main(void)
// Test serd_strerror
- 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"));
// Test file URI escaping and parsing