summaryrefslogtreecommitdiffstats
path: root/src/sord_test.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-05-24 14:12:05 +0000
committerDavid Robillard <d@drobilla.net>2011-05-24 14:12:05 +0000
commit936c70a02f140c3ad9d13f2b222859479e860690 (patch)
treef570bdd46343e0e5a1956c4fc08733d95cfa6227 /src/sord_test.c
parent7c1e48a2902373c5b2d893bd9ffd44056c044538 (diff)
downloadsord-936c70a02f140c3ad9d13f2b222859479e860690.tar.gz
sord-936c70a02f140c3ad9d13f2b222859479e860690.tar.bz2
sord-936c70a02f140c3ad9d13f2b222859479e860690.zip
Fix removing.
git-svn-id: http://svn.drobilla.net/sord/trunk@125 3d64ff67-21c5-427c-a301-fe4f08042e5a
Diffstat (limited to 'src/sord_test.c')
-rw-r--r--src/sord_test.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/sord_test.c b/src/sord_test.c
index cb36ece..71d5453 100644
--- a/src/sord_test.c
+++ b/src/sord_test.c
@@ -334,6 +334,26 @@ main(int argc, char** argv)
sord_free(sord);
}
+ // Test removing
+ sord = sord_new(world, SORD_SPO, false);
+ SordQuad tup = { 0, 0, 0, 0};
+ tup[0] = uri(world, 1);
+ tup[1] = uri(world, 2);
+ tup[2] = sord_new_literal(world, 0, USTR("hello"), NULL);
+ tup[3] = 0;
+ sord_add(sord, tup);
+ sord_node_free(world, (SordNode*)tup[2]);
+ tup[2] = sord_new_literal(world, 0, USTR("hi"), NULL);
+ sord_add(sord, tup);
+ sord_remove(sord, tup);
+ if (sord_num_quads(sord) != 1) {
+ fprintf(stderr, "Removed failed (%zu quads, expected 1)\n",
+ sord_num_quads(sord));
+ goto fail;
+ }
+
+ sord_free(sord);
+
sord_world_free(world);
return EXIT_SUCCESS;