aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test_node.c8
-rw-r--r--test/test_uri.c4
2 files changed, 8 insertions, 4 deletions
diff --git a/test/test_node.c b/test/test_node.c
index 67958cc5..f08363cb 100644
--- a/test/test_node.c
+++ b/test/test_node.c
@@ -121,14 +121,16 @@ test_blob_to_node(void)
data[i] = (uint8_t)((size + i) % 256);
}
- SerdNode blob = serd_node_new_blob(data, size, size % 5);
+ SerdNode blob = serd_node_new_blob(data, size, size % 5);
+ const uint8_t* const blob_str = blob.buf;
+ assert(blob_str);
assert(blob.n_bytes == blob.n_chars);
- assert(blob.n_bytes == strlen((const char*)blob.buf));
+ assert(blob.n_bytes == strlen((const char*)blob_str));
size_t out_size = 0;
uint8_t* out =
- (uint8_t*)serd_base64_decode(blob.buf, blob.n_bytes, &out_size);
+ (uint8_t*)serd_base64_decode(blob_str, blob.n_bytes, &out_size);
assert(out_size == size);
for (size_t i = 0; i < size; ++i) {
diff --git a/test/test_uri.c b/test/test_uri.c
index ac24a2be..cc81b40e 100644
--- a/test/test_uri.c
+++ b/test/test_uri.c
@@ -48,7 +48,9 @@ test_file_uri(const char* const hostname,
SerdNode node = serd_node_new_file_uri(USTR(path), USTR(hostname), 0, escape);
uint8_t* out_hostname = NULL;
- uint8_t* out_path = serd_file_uri_parse(node.buf, &out_hostname);
+ uint8_t* out_path =
+ serd_file_uri_parse((const uint8_t*)node.buf, &out_hostname);
+
assert(!strcmp((const char*)node.buf, expected_uri));
assert((hostname && out_hostname) || (!hostname && !out_hostname));
assert(!hostname || !strcmp(hostname, (const char*)out_hostname));