diff options
author | David Robillard <d@drobilla.net> | 2019-06-21 21:12:45 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-06-21 21:12:45 +0200 |
commit | 6d0995694ca5a3de916cc9746f4104f066b22718 (patch) | |
tree | 0df02301fd180f5be983757f8d57a67150351c9c /test | |
parent | 630ee8c69bb755cf3b3882554602f249e7757964 (diff) | |
download | lilv-6d0995694ca5a3de916cc9746f4104f066b22718.tar.gz lilv-6d0995694ca5a3de916cc9746f4104f066b22718.tar.bz2 lilv-6d0995694ca5a3de916cc9746f4104f066b22718.zip |
Refuse to store duplicate properties when saving plugin state
Diffstat (limited to 'test')
-rw-r--r-- | test/test.lv2/test.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test.lv2/test.c b/test/test.lv2/test.c index f15b4dd..bf0f87b 100644 --- a/test/test.lv2/test.c +++ b/test/test.lv2/test.c @@ -202,6 +202,17 @@ save(LV2_Handle instance, map_uri(plugin, LV2_ATOM__URID), LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE); + // Try to store second value for the same property (should fail) + const uint32_t urid2 = map_uri(plugin, "http://example.org/urivalue2"); + if (!store(callback_data, + map_uri(plugin, "http://example.org/uri"), + &urid2, + sizeof(uint32_t), + map_uri(plugin, LV2_ATOM__URID), + LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE)) { + return LV2_STATE_ERR_UNKNOWN; + } + store(callback_data, map_uri(plugin, "http://example.org/num-runs"), &plugin->num_runs, |