summaryrefslogtreecommitdiffstats
path: root/test/test_prototype.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_prototype.c')
-rw-r--r--test/test_prototype.c56
1 files changed, 23 insertions, 33 deletions
diff --git a/test/test_prototype.c b/test/test_prototype.c
index 4ad516e..4e17a63 100644
--- a/test/test_prototype.c
+++ b/test/test_prototype.c
@@ -1,18 +1,5 @@
-/*
- Copyright 2007-2020 David Robillard <http://drobilla.net>
-
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies.
-
- THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-*/
+// Copyright 2007-2020 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
#undef NDEBUG
@@ -73,28 +60,31 @@ static const char* const plugin_ttl = "\
int
main(void)
{
- LilvTestEnv* const env = lilv_test_env_new();
- LilvWorld* const world = env->world;
+ LilvTestEnv* const env = lilv_test_env_new();
+ LilvWorld* const world = env->world;
+
+ if (create_bundle(env, "prototype.lv2", manifest_ttl, plugin_ttl)) {
+ return 1;
+ }
- if (start_bundle(env, manifest_ttl, plugin_ttl)) {
- return 1;
- }
+ lilv_world_load_specifications(env->world);
+ lilv_world_load_bundle(env->world, env->test_bundle_uri);
- const LilvPlugins* plugins = lilv_world_get_all_plugins(world);
- const LilvPlugin* plug = lilv_plugins_get_by_uri(plugins, env->plugin1_uri);
- assert(plug);
+ const LilvPlugins* plugins = lilv_world_get_all_plugins(world);
+ const LilvPlugin* plug = lilv_plugins_get_by_uri(plugins, env->plugin1_uri);
+ assert(plug);
- // Test non-inherited property
- LilvNode* name = lilv_plugin_get_name(plug);
- assert(!strcmp(lilv_node_as_string(name), "Instance"));
- lilv_node_free(name);
+ // Test non-inherited property
+ LilvNode* name = lilv_plugin_get_name(plug);
+ assert(!strcmp(lilv_node_as_string(name), "Instance"));
+ lilv_node_free(name);
- // Test inherited property
- const LilvNode* binary = lilv_plugin_get_library_uri(plug);
- assert(strstr(lilv_node_as_string(binary), "inst" SHLIB_EXT));
+ // Test inherited property
+ const LilvNode* binary = lilv_plugin_get_library_uri(plug);
+ assert(strstr(lilv_node_as_string(binary), "inst" SHLIB_EXT));
- delete_bundle(env);
- lilv_test_env_free(env);
+ delete_bundle(env);
+ lilv_test_env_free(env);
- return 0;
+ return 0;
}