diff options
author | David Robillard <d@drobilla.net> | 2018-04-29 18:29:03 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-05-27 18:23:15 +0200 |
commit | b81b27fd762c3a3880070277a6d563a1c6913c1a (patch) | |
tree | ad3aa5def3cffa2f0d4abf564f748f0aea00e649 /tests | |
parent | 3efbbdb49f4122d3879007227eafc5afe520d7c5 (diff) | |
download | serd-b81b27fd762c3a3880070277a6d563a1c6913c1a.tar.gz serd-b81b27fd762c3a3880070277a6d563a1c6913c1a.tar.bz2 serd-b81b27fd762c3a3880070277a6d563a1c6913c1a.zip |
Make serd_node_new_literal take datatype as a node
Diffstat (limited to 'tests')
-rw-r--r-- | tests/serd_test.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/serd_test.c b/tests/serd_test.c index ccb3c5b6..a7008e9f 100644 --- a/tests/serd_test.c +++ b/tests/serd_test.c @@ -356,9 +356,12 @@ main(void) } serd_node_free(hello_l); - SerdNode* hello_dt = - serd_node_new_literal("hello_dt\"", "http://example.org/Thing", NULL); - if (serd_node_get_length(hello_dt) != 9 || + 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); + if (serd_node_get_length(hello_dt) != 9 || strcmp(serd_node_get_string(hello_dt), "hello_dt\"") || serd_node_get_flags(hello_dt) != (SERD_HAS_QUOTE | SERD_HAS_DATATYPE) || strcmp(serd_node_get_string(serd_node_get_datatype(hello_dt)), @@ -366,6 +369,7 @@ main(void) FAILF("Bad node %s\n", serd_node_get_string(hello_dt)); } serd_node_free(hello_dt); + serd_node_free(eg_Thing); // Test serd_node_new_uri_from_string @@ -542,7 +546,9 @@ main(void) } } - 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 }, @@ -587,6 +593,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 }; |