summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-07-24 19:16:10 -0400
committerDavid Robillard <d@drobilla.net>2016-07-24 19:17:07 -0400
commitfe294dfcf5b009d7dd5dd18b7a26f71eb619a893 (patch)
treefcacac7b16b39a92d4f908d2b36fbe963d100e43 /test
parentd92e316db4d5e28a05400d834e9f43c592f764fb (diff)
downloadlilv-fe294dfcf5b009d7dd5dd18b7a26f71eb619a893.tar.gz
lilv-fe294dfcf5b009d7dd5dd18b7a26f71eb619a893.tar.bz2
lilv-fe294dfcf5b009d7dd5dd18b7a26f71eb619a893.zip
Add lilv_state_set_metadata()
This allows setting useful metadata on a state description accessible to hosts but not plugins, such as pset:bank and rdfs:comment. Based on patch from Hanspeter Portner.
Diffstat (limited to 'test')
-rw-r--r--test/lilv_test.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/lilv_test.c b/test/lilv_test.c
index ca73b42..eb06dcd 100644
--- a/test/lilv_test.c
+++ b/test/lilv_test.c
@@ -1661,6 +1661,18 @@ test_state(void)
get_port_value, world, 0, NULL);
TEST_ASSERT(lilv_state_equals(state2, state4));
+ // Set some metadata properties
+ lilv_state_set_metadata(state, map.map(map.handle, LILV_NS_RDFS "comment"),
+ "This is a comment",
+ strlen("This is a comment") + 1,
+ map.map(map.handle, "http://lv2plug.in/ns/ext/atom#Literal"),
+ LV2_STATE_IS_POD);
+ lilv_state_set_metadata(state, map.map(map.handle, "http://example.org/metablob"),
+ "LIVEBEEF",
+ strlen("LIVEBEEF") + 1,
+ map.map(map.handle, "http://example.org/MetaBlob"),
+ 0);
+
// Save state to a directory
int ret = lilv_state_save(world, &map, &unmap, state, NULL,
"state/state.lv2", "state.ttl");