From bb733c2283b7f9ffb1f05d57457475adb91bd04a Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 9 Jan 2012 15:57:45 +0000 Subject: Make lilv_state_save take a full filename with extension. Use a proper path joining function for separator normalisation. git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@3927 a436a847-0d15-0410-975c-d299462d15a1 --- test/lilv_test.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'test/lilv_test.c') diff --git a/test/lilv_test.c b/test/lilv_test.c index 0591d20..7f7c77b 100644 --- a/test/lilv_test.c +++ b/test/lilv_test.c @@ -1157,7 +1157,7 @@ test_state(void) // Save state to a directory int ret = lilv_state_save(world, &unmap, state, NULL, - "./state.lv2", "state", NULL); + "./state.lv2", "state.ttl", NULL); TEST_ASSERT(!ret); // Load state from directory @@ -1221,7 +1221,7 @@ test_state(void) // Save state to a directory ret = lilv_state_save(world, &unmap, fstate, NULL, - "./fstate.lv2", "fstate", ffeatures); + "./fstate.lv2", "fstate.ttl", ffeatures); TEST_ASSERT(!ret); // Load state from directory @@ -1239,7 +1239,7 @@ test_state(void) // Save state to a directory again ret = lilv_state_save(world, &unmap, fstate, NULL, - "./fstate6.lv2", "fstate6", ffeatures); + "./fstate6.lv2", "fstate6.ttl", ffeatures); TEST_ASSERT(!ret); // Reload it and ensure it's identical to the other loaded version @@ -1257,7 +1257,7 @@ test_state(void) // Save the changed state to a directory again ret = lilv_state_save(world, &unmap, fstate7, NULL, - "./fstate7.lv2", "fstate7", ffeatures); + "./fstate7.lv2", "fstate7.ttl", ffeatures); TEST_ASSERT(!ret); // Reload it and ensure it's changed @@ -1381,6 +1381,10 @@ test_string(void) TEST_ASSERT(!strcmp((s = lilv_path_relative_to("/a", "/b/c/")), "/a")); TEST_ASSERT(!strcmp((s = lilv_path_relative_to("/a/b/c", "/a/b/d/")), "../c")); TEST_ASSERT(!strcmp((s = lilv_path_relative_to("/a/b/c", "/a/b/d/e/")), "../../c")); + TEST_ASSERT(!strcmp((s = lilv_path_join("/a", "b")), "/a/b")); + TEST_ASSERT(!strcmp((s = lilv_path_join("/a", "/b")), "/a/b")); + TEST_ASSERT(!strcmp((s = lilv_path_join("/a/", "/b")), "/a/b")); + TEST_ASSERT(!strcmp((s = lilv_path_join("/a/", "b")), "/a/b")); return 1; } @@ -1398,11 +1402,11 @@ static struct TestCase tests[] = { TEST_CASE(plugin), TEST_CASE(port), TEST_CASE(ui), - TEST_CASE(state), TEST_CASE(bad_port_symbol), TEST_CASE(bad_port_index), TEST_CASE(bad_port_index), TEST_CASE(string), + TEST_CASE(state), { NULL, NULL } }; -- cgit v1.2.1