From e750f4b6734d086e433e3c9c05b2252f43f4be8f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 10 May 2023 21:06:16 -0400 Subject: Add SerdNodes for storing a cache of interned nodes --- test/test_uri.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'test/test_uri.c') diff --git a/test/test_uri.c b/test/test_uri.c index 7a15ffb8..294b00ec 100644 --- a/test/test_uri.c +++ b/test/test_uri.c @@ -7,6 +7,7 @@ #include "serd/memory.h" #include "serd/node.h" +#include "serd/nodes.h" #include "serd/string_view.h" #include "serd/uri.h" @@ -75,8 +76,10 @@ test_file_uri(const char* const hostname, expected_path = path; } - SerdNode* node = serd_node_new( - NULL, serd_a_file_uri(serd_string(path), serd_string(hostname))); + SerdNodes* const nodes = serd_nodes_new(NULL); + + const SerdNode* node = serd_nodes_get( + nodes, serd_a_file_uri(serd_string(path), serd_string(hostname))); const char* node_str = serd_node_string(node); char* out_hostname = NULL; @@ -89,7 +92,7 @@ test_file_uri(const char* const hostname, serd_free(NULL, out_path); serd_free(NULL, out_hostname); - serd_node_free(NULL, node); + serd_nodes_free(nodes); } static void @@ -231,6 +234,7 @@ check_relative_uri(const char* const uri_string, const SerdURIView uri = serd_node_uri_view(uri_node); SerdNode* const base_node = serd_node_new(NULL, serd_a_uri_string(base_string)); + const SerdURIView base = serd_node_uri_view(base_node); SerdNode* result_node = NULL; @@ -246,7 +250,6 @@ check_relative_uri(const char* const uri_string, serd_uri_is_within(uri, root) ? serd_node_new(NULL, serd_a_parsed_uri(serd_relative_uri(uri, base))) : serd_node_new(NULL, serd_a_uri_string(uri_string)); - serd_node_free(NULL, root_node); } -- cgit v1.2.1