diff options
author | David Robillard <d@drobilla.net> | 2012-03-06 21:37:14 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-03-06 21:37:14 +0000 |
commit | ed67de4c9e7170b95b6bc798044c37be31b375f1 (patch) | |
tree | 920997f4f05cf122776bde0d384462862a21d9c7 /test | |
parent | e45691df6be3f9a14cab019437ce2f2e8a54427e (diff) | |
download | lilv-ed67de4c9e7170b95b6bc798044c37be31b375f1.tar.gz lilv-ed67de4c9e7170b95b6bc798044c37be31b375f1.tar.bz2 lilv-ed67de4c9e7170b95b6bc798044c37be31b375f1.zip |
Add lilv_state_new_from_string().
git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@4024 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'test')
-rw-r--r-- | test/lilv_test.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/lilv_test.c b/test/lilv_test.c index db2dca5..1031685 100644 --- a/test/lilv_test.c +++ b/test/lilv_test.c @@ -1206,6 +1206,16 @@ test_state(void) // Ensure they are equal TEST_ASSERT(lilv_state_equals(state, state2)); + // Save state to a string + char* state1_str = lilv_state_to_string( + world, &map, &unmap, state, "http://example.org/state1"); + + // Restore from string + LilvState* from_str = lilv_state_new_from_string(world, &map, state1_str); + + // Ensure they are equal + TEST_ASSERT(lilv_state_equals(state, from_str)); + const LilvNode* state_plugin_uri = lilv_state_get_plugin_uri(state); TEST_ASSERT(lilv_node_equals(state_plugin_uri, plugin_uri)); @@ -1367,6 +1377,7 @@ test_state(void) lilv_node_free(num); lilv_state_free(state); + lilv_state_free(from_str); lilv_state_free(state2); lilv_state_free(state3); lilv_state_free(state4); |