diff options
author | David Robillard <d@drobilla.net> | 2016-07-11 11:04:12 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2016-07-11 11:04:12 -0400 |
commit | 994fb58c3380949c8c63bbf647e2ad936ba6b906 (patch) | |
tree | 036f1eac04dc1a6fbcdefe6a5421392c2688f744 /src | |
parent | 698fe39665cfc68ad9429a5b853717bb3244643a (diff) | |
download | sord-994fb58c3380949c8c63bbf647e2ad936ba6b906.tar.gz sord-994fb58c3380949c8c63bbf647e2ad936ba6b906.tar.bz2 sord-994fb58c3380949c8c63bbf647e2ad936ba6b906.zip |
Improve test coverage
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 }; |