summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test_sord.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/test_sord.c b/test/test_sord.c
index bf7ac32..954076b 100644
--- a/test/test_sord.c
+++ b/test/test_sord.c
@@ -180,6 +180,7 @@ test_read(SordWorld* world, SordModel* sord, SordNode* g, const size_t n_quads)
SordIter* iter = sord_begin(sord);
if (sord_iter_get_model(iter) != sord) {
+ sord_iter_free(iter);
return test_fail("Fail: Iterator has incorrect sord pointer\n");
}
@@ -189,6 +190,7 @@ test_read(SordWorld* world, SordModel* sord, SordNode* g, const size_t n_quads)
// Attempt to increment past end
if (!sord_iter_next(iter)) {
+ sord_iter_free(iter);
return test_fail("Fail: Successfully incremented past end\n");
}
@@ -315,6 +317,8 @@ test_read(SordWorld* world, SordModel* sord, SordNode* g, const size_t n_quads)
SordIter* subiter = sord_find(sord, subpat);
unsigned num_sub_results = 0;
if (sord_iter_get_node(subiter, SORD_SUBJECT) != id[0]) {
+ sord_iter_free(iter);
+ sord_iter_free(subiter);
return test_fail("Fail: Incorrect initial submatch\n");
}
for (; !sord_iter_end(subiter); sord_iter_next(subiter)) {
@@ -329,6 +333,7 @@ test_read(SordWorld* world, SordModel* sord, SordNode* g, const size_t n_quads)
}
sord_iter_free(subiter);
if (num_sub_results != N_OBJECTS_PER) {
+ sord_iter_free(iter);
return test_fail("Fail: Nested query " TUP_FMT " failed"
" (%u results, expected %u)\n",
TUP_FMT_ARGS(subpat),
@@ -338,6 +343,7 @@ test_read(SordWorld* world, SordModel* sord, SordNode* g, const size_t n_quads)
uint64_t count = sord_count(sord, id[0], 0, 0, 0);
if (count != num_sub_results) {
+ sord_iter_free(iter);
return test_fail("Fail: Query " TUP_FMT " sord_count() %" PRIu64
"does not match result count %u\n",
TUP_FMT_ARGS(subpat),