diff options
author | David Robillard <d@drobilla.net> | 2020-07-15 16:27:19 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-07-16 23:37:49 +0200 |
commit | 133de18003a7fe1d7ab4b88beeeef413d1eb28ac (patch) | |
tree | 4720a92b811032b0905b532d5df44706150ab0b8 /test/test_project_no_author.c | |
parent | 35177a5becb4955ad3c48eaabd83bcc0fa60ef94 (diff) | |
download | lilv-133de18003a7fe1d7ab4b88beeeef413d1eb28ac.tar.gz lilv-133de18003a7fe1d7ab4b88beeeef413d1eb28ac.tar.bz2 lilv-133de18003a7fe1d7ab4b88beeeef413d1eb28ac.zip |
Split test suite up into several independent programs
Diffstat (limited to 'test/test_project_no_author.c')
-rw-r--r-- | test/test_project_no_author.c | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/test/test_project_no_author.c b/test/test_project_no_author.c new file mode 100644 index 0000000..017d359 --- /dev/null +++ b/test/test_project_no_author.c @@ -0,0 +1,87 @@ +/* + 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. +*/ + +#undef NDEBUG + +#include "lilv_test_utils.h" + +#include "lilv/lilv.h" + +#include <assert.h> + +static const char* const plugin_ttl = "\ +:plug a lv2:Plugin ;\n\ + a lv2:CompressorPlugin ;\n\ + doap:name \"Test plugin with project\" ;\n\ + lv2:project [\n\ + doap:name \"Fake project\" ;\n\ + ] ;\n\ + lv2:port [\n\ + a lv2:ControlPort ;\n\ + a lv2:InputPort ;\n\ + lv2:index 0 ;\n\ + lv2:symbol \"foo\" ;\n\ + lv2:name \"bar\" ;\n\ + lv2:minimum -1.0 ;\n\ + lv2:maximum 1.0 ;\n\ + lv2:default 0.5\n\ + ] , [\n\ + a lv2:ControlPort ;\n\ + a lv2:InputPort ;\n\ + lv2:index 1 ;\n\ + lv2:symbol \"bar\" ;\n\ + lv2:name \"Baz\" ;\n\ + lv2:minimum -2.0 ;\n\ + lv2:maximum 2.0 ;\n\ + lv2:default 1.0\n\ + ] , [\n\ + a lv2:ControlPort ;\n\ + a lv2:OutputPort ;\n\ + lv2:index 2 ;\n\ + lv2:symbol \"latency\" ;\n\ + lv2:name \"Latency\" ;\n\ + lv2:portProperty lv2:reportsLatency ;\n\ + lv2:designation lv2:latency\n\ + ] .\n"; + +int +main(void) +{ + LilvTestEnv* const env = lilv_test_env_new(); + LilvWorld* const world = env->world; + + if (start_bundle(env, SIMPLE_MANIFEST_TTL, plugin_ttl)) { + return 1; + } + + const LilvPlugins* plugins = lilv_world_get_all_plugins(world); + const LilvPlugin* plug = lilv_plugins_get_by_uri(plugins, env->plugin1_uri); + assert(plug); + + LilvNode* author_name = lilv_plugin_get_author_name(plug); + assert(!author_name); + + LilvNode* author_email = lilv_plugin_get_author_email(plug); + assert(!author_email); + + LilvNode* author_homepage = lilv_plugin_get_author_homepage(plug); + assert(!author_homepage); + + delete_bundle(env); + lilv_test_env_free(env); + + return 0; +} |