diff options
author | David Robillard <d@drobilla.net> | 2018-04-29 18:29:03 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-01-13 22:59:49 -0500 |
commit | db3799cd77f8f4e6525ea31c4d5f9400f47aa228 (patch) | |
tree | cd5e3d85c9f5a0483bf26847f39a54a5e39cfa5f /test/test_uri.c | |
parent | bfece96cead96fdcdb11567f1cf031edc3f53a8b (diff) | |
download | serd-db3799cd77f8f4e6525ea31c4d5f9400f47aa228.tar.gz serd-db3799cd77f8f4e6525ea31c4d5f9400f47aa228.tar.bz2 serd-db3799cd77f8f4e6525ea31c4d5f9400f47aa228.zip |
Simplify node construction API
Diffstat (limited to 'test/test_uri.c')
-rw-r--r-- | test/test_uri.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/test_uri.c b/test/test_uri.c index 4eb4cc29..5d204a71 100644 --- a/test/test_uri.c +++ b/test/test_uri.c @@ -54,7 +54,9 @@ test_file_uri(const char* const hostname, expected_path = path; } - SerdNode* node = serd_new_file_uri(path, hostname, 0); + SerdNode* node = + serd_new_file_uri(SERD_STRING(path), SERD_OPTIONAL_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); @@ -160,7 +162,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_STRING(uri_string)); const int ret = strcmp(serd_node_string(rel), expected); serd_node_free(rel); @@ -170,8 +172,10 @@ 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_STRING("http://example.org/a/b/ignored")); + + SerdNode* const base = serd_new_uri(SERD_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, "../../"); |