From 2501f12f80c3eebed55e5b253ced5a29ac443949 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 24 Dec 2011 23:37:00 +0000 Subject: Cover serd_node_from_string. git-svn-id: http://svn.drobilla.net/serd/trunk@275 490d8e77-9747-427b-9fa3-0b8f29cee8a0 --- tests/serd_test.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests') diff --git a/tests/serd_test.c b/tests/serd_test.c index 725517b4..c5c650da 100644 --- a/tests/serd_test.c +++ b/tests/serd_test.c @@ -155,6 +155,7 @@ main() } // Test serd_uri_to_path + const uint8_t* uri = (const uint8_t*)"file:///home/user/foo.ttl"; if (strcmp((const char*)serd_uri_to_path(uri), "/home/user/foo.ttl")) { fprintf(stderr, "Bad path %s for %s\n", serd_uri_to_path(uri), uri); @@ -176,6 +177,16 @@ main() return 1; } + // Test serd_node_from_string + + SerdNode node = serd_node_from_string(SERD_LITERAL, (const uint8_t*)"hello\""); + if (node.n_bytes != 6 || node.n_chars != 6 || node.flags != SERD_HAS_QUOTE + || strcmp((const char*)node.buf, "hello\"")) { + fprintf(stderr, "Bad node %s %zu %zu %d %d\n", + node.buf, node.n_bytes, node.n_chars, node.flags, node.type); + return 1; + } + printf("Success\n"); return 0; } -- cgit v1.2.1