diff options
author | David Robillard <d@drobilla.net> | 2018-04-29 18:29:03 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-10-27 13:13:58 +0100 |
commit | 48a9bed4cf7dc2b81acb6c645f7d053e1b9ead6d (patch) | |
tree | 67a2f395fdf443f74e15bb7fe4111282e364528f /tests | |
parent | 87583c1f917756ebd06744cc39a20eee39c34010 (diff) | |
download | serd-48a9bed4cf7dc2b81acb6c645f7d053e1b9ead6d.tar.gz serd-48a9bed4cf7dc2b81acb6c645f7d053e1b9ead6d.tar.bz2 serd-48a9bed4cf7dc2b81acb6c645f7d053e1b9ead6d.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, 10 insertions, 5 deletions
diff --git a/tests/serd_test.c b/tests/serd_test.c index 2171710b..a99ce678 100644 --- a/tests/serd_test.c +++ b/tests/serd_test.c @@ -430,15 +430,17 @@ static void test_literal(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_length(hello_dt) == 9); assert(!strcmp(serd_node_string(hello_dt), "hello_dt\"")); - assert(serd_node_flags(hello_dt) == - (SERD_HAS_QUOTE | SERD_HAS_DATATYPE)); + assert(serd_node_flags(hello_dt) == (SERD_HAS_QUOTE | SERD_HAS_DATATYPE)); assert(!strcmp(serd_node_string(serd_node_datatype(hello_dt)), "http://example.org/Thing")); serd_node_free(hello_dt); + serd_node_free(eg_Thing); } static void @@ -549,7 +551,9 @@ test_writer(const char* const path) 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 }, @@ -585,6 +589,7 @@ test_writer(const char* const path) serd_node_free(o); serd_node_free(t); serd_node_free(l); + serd_node_free(urn_Type); // Test buffer sink SerdBuffer buffer = { NULL, 0 }; |