summaryrefslogtreecommitdiffstats
path: root/test/lilv_test.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-01-09 15:57:45 +0000
committerDavid Robillard <d@drobilla.net>2012-01-09 15:57:45 +0000
commitbb733c2283b7f9ffb1f05d57457475adb91bd04a (patch)
tree161c67f269b699ca0db0e1231d1ceeac186045ec /test/lilv_test.c
parent682cdde237bdcd1a804f7a2dd740d7c1f80ab838 (diff)
downloadlilv-bb733c2283b7f9ffb1f05d57457475adb91bd04a.tar.gz
lilv-bb733c2283b7f9ffb1f05d57457475adb91bd04a.tar.bz2
lilv-bb733c2283b7f9ffb1f05d57457475adb91bd04a.zip
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
Diffstat (limited to 'test/lilv_test.c')
-rw-r--r--test/lilv_test.c14
1 files changed, 9 insertions, 5 deletions
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 }
};