diff options
author | David Robillard <d@drobilla.net> | 2018-04-29 18:29:03 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-04-13 19:15:32 +0200 |
commit | 05d9109178906eb68ef6b488d115134c7bdcf179 (patch) | |
tree | d238d8f76c304440e8b32374b8989d1a3eceea3f /tests | |
parent | 61cc66d1f56dfe1cfa8da20f95d7152ca414c903 (diff) | |
download | serd-05d9109178906eb68ef6b488d115134c7bdcf179.tar.gz serd-05d9109178906eb68ef6b488d115134c7bdcf179.tar.bz2 serd-05d9109178906eb68ef6b488d115134c7bdcf179.zip |
Make serd_node_new_literal take datatype as a node
Diffstat (limited to 'tests')
-rw-r--r-- | tests/serd_test.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/serd_test.c b/tests/serd_test.c index c797322c..816eb83c 100644 --- a/tests/serd_test.c +++ b/tests/serd_test.c @@ -306,8 +306,10 @@ main(void) "en")); serd_node_free(hello_l); - SerdNode* hello_dt = serd_node_new_literal( - "hello_dt\"", "http://example.org/Thing", NULL); + SerdNode* eg_Thing = serd_node_new_uri_from_string( + "http://example.org/Thing", NULL, NULL); + + SerdNode* hello_dt = serd_node_new_literal("hello_dt\"", eg_Thing, NULL); assert(serd_node_get_length(hello_dt) == 9); assert(!strcmp(serd_node_get_string(hello_dt), "hello_dt\"")); assert(serd_node_get_flags(hello_dt) == @@ -315,6 +317,7 @@ main(void) assert(!strcmp(serd_node_get_string(serd_node_get_datatype(hello_dt)), "http://example.org/Thing")); serd_node_free(hello_dt); + serd_node_free(eg_Thing); // Test serd_node_new_uri_from_string @@ -460,7 +463,9 @@ main(void) junk[i][0], junk[i][1], junk[i][2])); } - SerdNode* t = serd_node_new_literal((char*)buf, "urn:Type", NULL); + SerdNode* urn_Type = serd_node_new_uri_from_string("urn:Type", NULL, NULL); + + SerdNode* t = serd_node_new_literal((char*)buf, urn_Type, NULL); SerdNode* l = serd_node_new_literal((char*)buf, NULL, "en"); const SerdNode* good[][5] = { { s, p, o }, { s, p, o }, @@ -498,6 +503,7 @@ main(void) serd_node_free(o); serd_node_free(t); serd_node_free(l); + serd_node_free(urn_Type); // Test buffer sink SerdBuffer buffer = { NULL, 0 }; |