summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-03-21 16:19:58 +0000
committerDavid Robillard <d@drobilla.net>2009-03-21 16:19:58 +0000
commit8a24811ad2d2e587af6fe5ad487af08f74bccf38 (patch)
treec3adc9e767e3bc61285e7b40926e5dc159a2c773 /test
parentf8dce53e02f71b56159907460a5cee963f52daaf (diff)
downloadlilv-8a24811ad2d2e587af6fe5ad487af08f74bccf38.tar.gz
lilv-8a24811ad2d2e587af6fe5ad487af08f74bccf38.tar.bz2
lilv-8a24811ad2d2e587af6fe5ad487af08f74bccf38.zip
Test cases for query API.
git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@1949 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'test')
-rw-r--r--test/slv2_test.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/slv2_test.c b/test/slv2_test.c
index 9c1348f..65eba90 100644
--- a/test/slv2_test.c
+++ b/test/slv2_test.c
@@ -574,7 +574,7 @@ test_plugin()
"] . \n"
":thing doap:name \"Something else\" .\n"))
return 0;
-
+
init_uris();
SLV2Plugins plugins = slv2_world_get_all_plugins(world);
SLV2Plugin plug = slv2_plugins_get_by_uri(plugins, plugin_uri_value);
@@ -692,6 +692,17 @@ test_plugin()
SLV2UIs uis = slv2_plugin_get_uis(plug);
TEST_ASSERT(slv2_uis_size(uis) == 0);
+
+ SLV2Results results = slv2_plugin_query_sparql(plug,
+"SELECT ?name WHERE { <> doap:maintainer [ foaf:name ?name ] }");
+ TEST_ASSERT(!slv2_results_finished(results));
+ TEST_ASSERT(!strcmp(slv2_results_get_binding_name(results, 0), "name"));
+ TEST_ASSERT(!strcmp(
+ slv2_value_as_string(slv2_results_get_binding_value(results, 0)),
+ "David Robillard"));
+ TEST_ASSERT(!strcmp(
+ slv2_value_as_string(slv2_results_get_binding_value_by_name(results, "name")),
+ "David Robillard"));
slv2_uis_free(uis);
slv2_values_free(thing_names);