diff options
author | David Robillard <d@drobilla.net> | 2008-12-13 17:53:20 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-12-13 17:53:20 +0000 |
commit | d0eb0725eed931a13197384149b1f97827af8e59 (patch) | |
tree | e7461641be04da36b6c399f952c294271bc64e31 /test | |
parent | 653b8103c8e146be8d5a3ae7cebc8deeca86c0cd (diff) | |
download | lilv-d0eb0725eed931a13197384149b1f97827af8e59.tar.gz lilv-d0eb0725eed931a13197384149b1f97827af8e59.tar.bz2 lilv-d0eb0725eed931a13197384149b1f97827af8e59.zip |
Test author information stuff: 86.2% coverage
git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@1865 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'test')
-rw-r--r-- | test/slv2_test.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/test/slv2_test.c b/test/slv2_test.c index 41335ec..5c8d6a4 100644 --- a/test/slv2_test.c +++ b/test/slv2_test.c @@ -573,6 +573,8 @@ test_plugin() LICENSE_GPL " ; " "lv2:optionalFeature lv2:hardRtCapable ; " "lv2:requiredFeature <http://lv2plug.in/ns/ext/event> ; " + "doap:maintainer [ foaf:name \"David Robillard\" ; " + " foaf:homepage <http://drobilla.net> ; foaf:mbox <mailto:dave@drobilla.net> ] ; " "lv2:port [ " " a lv2:ControlPort ; a lv2:InputPort ; " " lv2:index 0 ; lv2:symbol \"foo\" ; lv2:name \"bar\" ; " @@ -666,6 +668,18 @@ test_plugin() TEST_ASSERT(slv2_values_size(required) == 1); TEST_ASSERT(slv2_values_size(optional) == 1); + SLV2Value author_name = slv2_plugin_get_author_name(plug); + TEST_ASSERT(!strcmp(slv2_value_as_string(author_name), "David Robillard")); + slv2_value_free(author_name); + + SLV2Value author_email = slv2_plugin_get_author_email(plug); + TEST_ASSERT(!strcmp(slv2_value_as_string(author_email), "mailto:dave@drobilla.net")); + slv2_value_free(author_email); + + SLV2Value author_homepage = slv2_plugin_get_author_homepage(plug); + TEST_ASSERT(!strcmp(slv2_value_as_string(author_homepage), "http://drobilla.net")); + slv2_value_free(author_homepage); + slv2_value_free(control_class); slv2_value_free(audio_class); slv2_value_free(in_class); @@ -711,9 +725,15 @@ test_port() SLV2Value psym = slv2_value_new_string(world, "foo"); SLV2Port p = slv2_plugin_get_port_by_index(plug, 0); SLV2Port p2 = slv2_plugin_get_port_by_symbol(plug, psym); + slv2_value_free(psym); TEST_ASSERT(p != NULL); TEST_ASSERT(p2 != NULL); TEST_ASSERT(p == p2); + + SLV2Value nopsym = slv2_value_new_string(world, "thisaintnoportfoo"); + SLV2Port p3 = slv2_plugin_get_port_by_symbol(plug, nopsym); + TEST_ASSERT(p3 == NULL); + slv2_value_free(nopsym); SLV2Value audio_class = slv2_value_new_uri(world, "http://lv2plug.in/ns/lv2core#AudioPort"); @@ -841,7 +861,7 @@ run_tests() { int i; for (i = 0; tests[i].title; i++) { - printf("\n--- Test: %s\n", tests[i].title); + printf("--- Test: %s\n", tests[i].title); if (!tests[i].func()) { printf("\nTest failed\n"); /* test case that wasn't able to be executed at all counts as 1 test + 1 error */ @@ -863,7 +883,7 @@ main(int argc, char *argv[]) init_tests(); run_tests(); cleanup(); - printf("\n--- Results: %d tests, %d errors\n", test_count, error_count); + printf("\n***\n*** Test Results: %d tests, %d errors\n***\n\n", test_count, error_count); return error_count ? 1 : 0; } |