From bb2fdc70a61751d289f84b48dd016a68b045a50f Mon Sep 17 00:00:00 2001 From: Hanspeter Portner Date: Mon, 18 Jul 2016 19:35:19 +0200 Subject: 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. --- tests/sratom_test.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'tests') 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)1,2,3,4 + // eg_ivector = (Vector)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)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)1.0,2.0,3.0,4.0 + // eg_fvector = (Vector)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)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)1,0 + // eg_bvector = (Vector)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); -- cgit v1.2.1