summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-11-11 23:10:03 +0000
committerDavid Robillard <d@drobilla.net>2011-11-11 23:10:03 +0000
commit588cc25cc9c80ba8b1aafe5f65746d80f9ef54a5 (patch)
treefaf9c2025e26ed0e1ddf3cc556a9cb39c2b187d2 /test
parent9370aabc30ac2498b499eac4c26d3580f5ecddfa (diff)
downloadlilv-588cc25cc9c80ba8b1aafe5f65746d80f9ef54a5.tar.gz
lilv-588cc25cc9c80ba8b1aafe5f65746d80f9ef54a5.tar.bz2
lilv-588cc25cc9c80ba8b1aafe5f65746d80f9ef54a5.zip
Add lilv_plugin_has_extension_data.
Add tests for extension data functions. Tolerate (ignore) plugins with broken data with "gaps" in port indices. git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@3611 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'test')
-rw-r--r--test/lilv_test.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/lilv_test.c b/test/lilv_test.c
index 85f91da..2e17fb5 100644
--- a/test/lilv_test.c
+++ b/test/lilv_test.c
@@ -468,6 +468,7 @@ test_plugin(void)
LICENSE_GPL " ; "
"lv2:optionalFeature lv2:hardRTCapable ; "
"lv2:requiredFeature <http://lv2plug.in/ns/ext/event> ; "
+ "lv2:extensionData <http://example.org/extdata> ;"
":foo 1.6180 ; "
":bar true ; "
":baz false ; "
@@ -637,6 +638,16 @@ test_plugin(void)
TEST_ASSERT(lilv_uis_size(uis) == 0);
lilv_uis_free(uis);
+ LilvNode* extdata = lilv_new_uri(world, "http://example.org/extdata");
+ LilvNode* noextdata = lilv_new_uri(world, "http://example.org/noextdata");
+ LilvNodes* extdatas = lilv_plugin_get_extension_data(plug);
+ TEST_ASSERT(lilv_plugin_has_extension_data(plug, extdata));
+ TEST_ASSERT(!lilv_plugin_has_extension_data(plug, noextdata));
+ TEST_ASSERT(lilv_nodes_size(extdatas) == 1);
+ TEST_ASSERT(lilv_node_equals(lilv_nodes_get_first(extdatas), extdata));
+ lilv_node_free(extdata);
+ lilv_nodes_free(extdatas);
+
lilv_nodes_free(thing_names);
lilv_node_free(thing_uri);
lilv_node_free(name_p);