summaryrefslogtreecommitdiffstats
path: root/src/sord_test.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-01-14 06:53:05 +0000
committerDavid Robillard <d@drobilla.net>2013-01-14 06:53:05 +0000
commit5cd549c8e512d9a85d7d666db5da8b8a444a281f (patch)
tree2aa2c443cf9aaf675588242bf86e8c6e0fb547e5 /src/sord_test.c
parentfb40f19426ce147083c26c2fe9a9805f89fb8e9b (diff)
downloadsord-5cd549c8e512d9a85d7d666db5da8b8a444a281f.tar.gz
sord-5cd549c8e512d9a85d7d666db5da8b8a444a281f.tar.bz2
sord-5cd549c8e512d9a85d7d666db5da8b8a444a281f.zip
Add sord_node_get() for easily getting single property values.
git-svn-id: http://svn.drobilla.net/sord/trunk@280 3d64ff67-21c5-427c-a301-fe4f08042e5a
Diffstat (limited to 'src/sord_test.c')
-rw-r--r--src/sord_test.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/sord_test.c b/src/sord_test.c
index a7a74e5..36fc408 100644
--- a/src/sord_test.c
+++ b/src/sord_test.c
@@ -238,6 +238,22 @@ test_read(SordWorld* world, SordModel* sord, SordNode* g,
TUP_FMT_ARGS(nomatch));
}
+ if (sord_get(sord, NULL, NULL, uri(world, 3), g)) {
+ return test_fail("Fail: Get *,*,3 succeeded\n");
+ } else if (!sord_node_equals(
+ sord_get(sord, uri(world, 1), uri(world, 2), NULL, g),
+ uri(world, 3))) {
+ return test_fail("Fail: Get 1,2,* != 3\n");
+ } else if (!sord_node_equals(
+ sord_get(sord, uri(world, 1), NULL, uri(world, 3), g),
+ uri(world, 2))) {
+ return test_fail("Fail: Get 1,*,3 != 2\n");
+ } else if (!sord_node_equals(
+ sord_get(sord, NULL, uri(world, 2), uri(world, 3), g),
+ uri(world, 1))) {
+ return test_fail("Fail: Get *,2,3 != 1\n");
+ }
+
for (unsigned i = 0; i < NUM_PATTERNS; ++i) {
QueryTest test = patterns[i];
SordQuad pat = { test.query[0], test.query[1], test.query[2], g };