From 471ef4960aba6b5e1c9445229cddc0b3eb9ca148 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 29 Apr 2018 18:29:03 +0200 Subject: Simplify node construction API --- test/test_uri.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'test/test_uri.c') diff --git a/test/test_uri.c b/test/test_uri.c index d0dba037..ea70508b 100644 --- a/test/test_uri.c +++ b/test/test_uri.c @@ -35,7 +35,9 @@ test_file_uri(const char* hostname, expected_path = path; } - SerdNode* node = serd_new_file_uri(path, hostname, 0); + SerdNode* node = + serd_new_file_uri(SERD_MEASURE_STRING(path), SERD_MEASURE_STRING(hostname)); + const char* node_str = serd_node_string(node); char* out_hostname = NULL; char* out_path = serd_parse_file_uri(node_str, &out_hostname); @@ -143,7 +145,7 @@ check_rel_uri(const char* uri_string, SerdNode* const rel = is_within ? serd_new_parsed_uri(serd_relative_uri(uri, base_uri)) - : serd_new_uri(uri_string); + : serd_new_uri(SERD_MEASURE_STRING(uri_string)); const int ret = strcmp(serd_node_string(rel), expected); serd_node_free(rel); @@ -153,8 +155,11 @@ check_rel_uri(const char* uri_string, static void test_relative_uri(void) { - SerdNode* const root = serd_new_uri("http://example.org/a/b/ignored"); - SerdNode* const base = serd_new_uri("http://example.org/a/b/c/"); + SerdNode* const root = + serd_new_uri(SERD_STATIC_STRING("http://example.org/a/b/ignored")); + + SerdNode* const base = + serd_new_uri(SERD_STATIC_STRING("http://example.org/a/b/c/")); check_rel_uri("http://example.org/a/b/c/foo", base, NULL, "foo"); check_rel_uri("http://example.org/a/", base, NULL, "../../"); -- cgit v1.2.1