diff options
author | David Robillard <d@drobilla.net> | 2016-03-16 16:21:20 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-12-02 16:27:02 -0500 |
commit | 84bab08585dec858807a6130bd2d71f304b889f0 (patch) | |
tree | ea78338414095c2c871944a0135028e1399b12fe /test/test_string.c | |
parent | caa74939cba8b1cd357e553efca9bec5074b1c53 (diff) | |
download | serd-84bab08585dec858807a6130bd2d71f304b889f0.tar.gz serd-84bab08585dec858807a6130bd2d71f304b889f0.tar.bz2 serd-84bab08585dec858807a6130bd2d71f304b889f0.zip |
Use char* for strings in public API
The constant casting just makes user code a mess, for no benefit.
Diffstat (limited to 'test/test_string.c')
-rw-r--r-- | test/test_string.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/test_string.c b/test/test_string.c index 85dccd62..99db03f4 100644 --- a/test/test_string.c +++ b/test/test_string.c @@ -16,23 +16,23 @@ test_strlen(void) const uint8_t str[] = {'"', '5', 0xE2, 0x82, 0xAC, '"', '\n', 0}; SerdNodeFlags flags = 0; - size_t n_bytes = serd_strlen(str, &flags); + size_t n_bytes = serd_strlen((const char*)str, &flags); assert(n_bytes == 7 && flags == (SERD_HAS_QUOTE | SERD_HAS_NEWLINE)); - assert(serd_strlen(str, NULL) == 7); + assert(serd_strlen((const char*)str, NULL) == 7); } static void test_strerror(void) { - const uint8_t* msg = serd_strerror(SERD_SUCCESS); - assert(!strcmp((const char*)msg, "Success")); + const char* msg = serd_strerror(SERD_SUCCESS); + assert(!strcmp(msg, "Success")); for (int i = SERD_FAILURE; i <= SERD_ERR_BAD_TEXT; ++i) { msg = serd_strerror((SerdStatus)i); - assert(strcmp((const char*)msg, "Success")); + assert(strcmp(msg, "Success")); } msg = serd_strerror((SerdStatus)-1); - assert(!strcmp((const char*)msg, "Unknown error")); + assert(!strcmp(msg, "Unknown error")); } int |