From a29581d3ba664175c459e20e6c86be09707fde6e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 16 Mar 2016 16:21:20 -0400 Subject: Use char* for strings in public API The constant casting just makes user code a mess, for no benefit. --- test/test_string.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test/test_string.c') diff --git a/test/test_string.c b/test/test_string.c index 27a488fb..842ff3df 100644 --- a/test/test_string.c +++ b/test/test_string.c @@ -29,23 +29,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_INTERNAL; ++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 -- cgit v1.2.1