diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/sord_test.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/sord_test.c b/src/sord_test.c index c6e6a5b..5eeb6d6 100644 --- a/src/sord_test.c +++ b/src/sord_test.c @@ -403,6 +403,13 @@ main(int argc, char** argv) sord_node_free(world, badns); serd_env_free(env); + // Attempt to create node from garbage + SerdNode junk = SERD_NODE_NULL; + junk.type = 1234; + if (sord_node_from_serd_node(world, env, &junk, NULL, NULL)) { + return test_fail("Successfully created node from garbage serd node\n"); + } + // Attempt to create NULL node SordNode* nil_node = sord_node_from_serd_node( world, NULL, &SERD_NODE_NULL, NULL, NULL); @@ -656,6 +663,9 @@ main(int argc, char** argv) } sord_iter_free(iter); + // Test double remove (silent success) + sord_remove(sord, tup); + // Load a couple graphs SordNode* graph42 = uri(world, 42); SordNode* graph43 = uri(world, 43); @@ -674,6 +684,11 @@ main(int argc, char** argv) } sord_iter_free(iter); + iter = sord_begin(sord); + if (!sord_erase(sord, iter)) { + return test_fail("Succesfully erased iterator on empty model\n"); + } + // Ensure only the other graph is left SordQuad quad; SordQuad pat = { 0, 0, 0, graph42 }; |