diff options
author | David Robillard <d@drobilla.net> | 2018-04-29 18:29:03 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2021-03-07 15:32:24 -0500 |
commit | 471ef4960aba6b5e1c9445229cddc0b3eb9ca148 (patch) | |
tree | ae6ff30025ec510624c50aa6364a9171aca879bc /test/test_uri.c | |
parent | 941b14a0ab8f7c80f94e04762e65a48f9ed02f6e (diff) | |
download | serd-471ef4960aba6b5e1c9445229cddc0b3eb9ca148.tar.gz serd-471ef4960aba6b5e1c9445229cddc0b3eb9ca148.tar.bz2 serd-471ef4960aba6b5e1c9445229cddc0b3eb9ca148.zip |
Simplify node construction API
Diffstat (limited to 'test/test_uri.c')
-rw-r--r-- | test/test_uri.c | 13 |
1 files changed, 9 insertions, 4 deletions
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, "../../"); |