aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-11-18 18:26:37 +0100
committerDavid Robillard <d@drobilla.net>2019-04-13 19:15:32 +0200
commit83c04665b3981b3f0081dd98167419d951473202 (patch)
tree3407c27e1768ad2c895889cc4ddb88820541f080
parent799a8bdd9cc3c30d08309e4f68dfe24c1569c6ff (diff)
downloadserd-83c04665b3981b3f0081dd98167419d951473202.tar.gz
serd-83c04665b3981b3f0081dd98167419d951473202.tar.bz2
serd-83c04665b3981b3f0081dd98167419d951473202.zip
Improve node test coverage
-rw-r--r--tests/serd_test.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/serd_test.c b/tests/serd_test.c
index 6486e0ba..a2bb9013 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);