From 4711fdf527f416faee8ff19e15f050d4b48dcfb2 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 5 May 2023 09:43:57 -0400 Subject: [WIP] Generalize node construction API --- test/test_statement.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'test/test_statement.c') diff --git a/test/test_statement.c b/test/test_statement.c index 0127b7bf..fe1ce818 100644 --- a/test/test_statement.c +++ b/test/test_statement.c @@ -6,7 +6,6 @@ #include "serd/caret.h" #include "serd/node.h" #include "serd/statement.h" -#include "serd/string_view.h" #include #include @@ -16,9 +15,9 @@ static void test_new(void) { - SerdNode* const u = serd_new_uri(NULL, serd_string(NS_EG "s")); - SerdNode* const b = serd_new_blank(NULL, serd_string("b0")); - SerdNode* const l = serd_new_string(NULL, serd_string("str")); + SerdNode* const u = serd_node_new(NULL, serd_a_uri_string(NS_EG "s")); + SerdNode* const b = serd_node_new(NULL, serd_a_blank_string("b0")); + SerdNode* const l = serd_node_new(NULL, serd_a_string("str")); assert(!serd_statement_new(NULL, u, b, u, NULL, NULL)); assert(!serd_statement_new(NULL, l, u, u, NULL, NULL)); @@ -37,11 +36,11 @@ test_copy(void) { assert(!serd_statement_copy(NULL, NULL)); - SerdNode* const f = serd_new_string(NULL, serd_string("file")); - SerdNode* const s = serd_new_uri(NULL, serd_string(NS_EG "s")); - SerdNode* const p = serd_new_uri(NULL, serd_string(NS_EG "p")); - SerdNode* const o = serd_new_uri(NULL, serd_string(NS_EG "o")); - SerdNode* const g = serd_new_uri(NULL, serd_string(NS_EG "g")); + SerdNode* const f = serd_node_new(NULL, serd_a_string("file")); + SerdNode* const s = serd_node_new(NULL, serd_a_uri_string(NS_EG "s")); + SerdNode* const p = serd_node_new(NULL, serd_a_uri_string(NS_EG "p")); + SerdNode* const o = serd_node_new(NULL, serd_a_uri_string(NS_EG "o")); + SerdNode* const g = serd_node_new(NULL, serd_a_uri_string(NS_EG "g")); SerdCaret* const caret = serd_caret_new(NULL, f, 1, 1); SerdStatement* const statement = serd_statement_new(NULL, s, p, o, g, caret); @@ -69,11 +68,11 @@ test_free(void) static void test_fields(void) { - SerdNode* const f = serd_new_string(NULL, serd_string("file")); - SerdNode* const s = serd_new_uri(NULL, serd_string(NS_EG "s")); - SerdNode* const p = serd_new_uri(NULL, serd_string(NS_EG "p")); - SerdNode* const o = serd_new_uri(NULL, serd_string(NS_EG "o")); - SerdNode* const g = serd_new_uri(NULL, serd_string(NS_EG "g")); + SerdNode* const f = serd_node_new(NULL, serd_a_string("file")); + SerdNode* const s = serd_node_new(NULL, serd_a_uri_string(NS_EG "s")); + SerdNode* const p = serd_node_new(NULL, serd_a_uri_string(NS_EG "p")); + SerdNode* const o = serd_node_new(NULL, serd_a_uri_string(NS_EG "o")); + SerdNode* const g = serd_node_new(NULL, serd_a_uri_string(NS_EG "g")); SerdCaret* const caret = serd_caret_new(NULL, f, 1, 1); SerdStatement* const statement = serd_statement_new(NULL, s, p, o, g, caret); -- cgit v1.2.1