diff options
author | Hanspeter Portner <dev@open-music-kontrollers.ch> | 2016-07-18 19:35:19 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2016-07-24 09:51:21 -0400 |
commit | bb2fdc70a61751d289f84b48dd016a68b045a50f (patch) | |
tree | 41baab129d799410dd4fca76742e28003d60004b /tests | |
parent | d75e983c6e00fefdca561230cd21907a6deae98e (diff) | |
download | sratom-bb2fdc70a61751d289f84b48dd016a68b045a50f.tar.gz sratom-bb2fdc70a61751d289f84b48dd016a68b045a50f.tar.bz2 sratom-bb2fdc70a61751d289f84b48dd016a68b045a50f.zip |
Fix vector padding
A Vector must be padded properly, or a Vector with, for example, an odd
number of Int elements will cause the rest of the containing Atom to be
invalid.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/sratom_test.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/sratom_test.c b/tests/sratom_test.c index 012b901..a093462 100644 --- a/tests/sratom_test.c +++ b/tests/sratom_test.c @@ -238,30 +238,30 @@ test(bool top_level, bool pretty_numbers) lv2_atom_forge_pop(&forge, &subrectup_frame); lv2_atom_forge_pop(&forge, &rectup_frame); - // eg_ivector = (Vector<Int>)1,2,3,4 + // eg_ivector = (Vector<Int>)1,2,3,4,5 lv2_atom_forge_key(&forge, eg_ivector); - int32_t ielems[] = { 1, 2, 3, 4 }; - lv2_atom_forge_vector(&forge, sizeof(int32_t), forge.Int, 4, ielems); + int32_t ielems[] = { 1, 2, 3, 4, 5 }; + lv2_atom_forge_vector(&forge, sizeof(int32_t), forge.Int, 5, ielems); // eg_lvector = (Vector<Long>)1,2,3,4 lv2_atom_forge_key(&forge, eg_lvector); int64_t lelems[] = { 1, 2, 3, 4 }; lv2_atom_forge_vector(&forge, sizeof(int64_t), forge.Long, 4, lelems); - // eg_fvector = (Vector<Float>)1.0,2.0,3.0,4.0 + // eg_fvector = (Vector<Float>)1.0,2.0,3.0,4.0,5.0 lv2_atom_forge_key(&forge, eg_fvector); - float felems[] = { 1, 2, 3, 4 }; - lv2_atom_forge_vector(&forge, sizeof(float), forge.Float, 4, felems); + float felems[] = { 1, 2, 3, 4, 5 }; + lv2_atom_forge_vector(&forge, sizeof(float), forge.Float, 5, felems); // eg_dvector = (Vector<Double>)1.0,2.0,3.0,4.0 lv2_atom_forge_key(&forge, eg_dvector); double delems[] = { 1, 2, 3, 4 }; lv2_atom_forge_vector(&forge, sizeof(double), forge.Double, 4, delems); - // eg_bvector = (Vector<Bool>)1,0 + // eg_bvector = (Vector<Bool>)1,0,1 lv2_atom_forge_key(&forge, eg_bvector); - int32_t belems[] = { true, false }; - lv2_atom_forge_vector(&forge, sizeof(int32_t), forge.Bool, 2, belems); + int32_t belems[] = { true, false , true }; + lv2_atom_forge_vector(&forge, sizeof(int32_t), forge.Bool, 3, belems); // eg_fseq = (Sequence)1, 2 LV2_URID midi_midiEvent = map.map(map.handle, LV2_MIDI__MidiEvent); |