diff options
author | David Robillard <d@drobilla.net> | 2018-11-18 18:26:37 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-12-31 11:37:49 -0500 |
commit | f910557310a42685022ee413af5501f71fad92a0 (patch) | |
tree | eb627bd74d1a2ffa8fb8972a18fb28415294f72e /tests | |
parent | 79af3ce1db50728bd88e8b236543d3903cc0bec0 (diff) | |
download | serd-f910557310a42685022ee413af5501f71fad92a0.tar.gz serd-f910557310a42685022ee413af5501f71fad92a0.tar.bz2 serd-f910557310a42685022ee413af5501f71fad92a0.zip |
Improve node test coverage
Diffstat (limited to 'tests')
-rw-r--r-- | tests/serd_test.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/serd_test.c b/tests/serd_test.c index 9564af17..88528775 100644 --- a/tests/serd_test.c +++ b/tests/serd_test.c @@ -209,6 +209,8 @@ main(void) } // Test serd_new_blob + assert(!serd_new_blob(NULL, 0, true, NULL)); + assert(!serd_new_blob("data", 0, true, NULL)); for (size_t size = 1; size < 256; ++size) { uint8_t* data = (uint8_t*)malloc(size); for (size_t i = 0; i < size; ++i) { @@ -307,6 +309,8 @@ main(void) assert(!serd_new_plain_literal(NULL, NULL)); assert(!serd_new_typed_literal(NULL, NULL)); + assert(!serd_new_typed_literal("bad type", hello)); + SerdNode* hello2 = serd_new_string("hello\""); assert(serd_node_get_length(hello2) == 6 && serd_node_get_flags(hello2) == SERD_HAS_QUOTE && @@ -315,6 +319,10 @@ main(void) SerdNode* hello3 = serd_new_plain_literal("hello\"", NULL); assert(serd_node_equals(hello2, hello3)); + SerdNode* hello4 = serd_new_typed_literal("hello\"", NULL); + assert(serd_node_equals(hello4, hello2)); + + serd_node_free(hello4); serd_node_free(hello3); serd_node_free(hello2); |