summaryrefslogtreecommitdiff
path: root/test/lv2_test_host.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2016-01-20 11:52:43 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2016-01-20 11:52:43 +0100
commitfd6c48a3406c69d3ec4aec43a49ab29571d8ad4b (patch)
treeb3ed7ef8223836b5546759562b62631a89b940c0 /test/lv2_test_host.cc
parentc5d8be097554e5735748577e7967fae11b32d388 (diff)
Update LV2/lilv unit-test.
Diffstat (limited to 'test/lv2_test_host.cc')
-rw-r--r--test/lv2_test_host.cc19
1 files changed, 5 insertions, 14 deletions
diff --git a/test/lv2_test_host.cc b/test/lv2_test_host.cc
index 927f94c..375ae40 100644
--- a/test/lv2_test_host.cc
+++ b/test/lv2_test_host.cc
@@ -40,17 +40,7 @@
//
#include <openssl/bio.h>
#include <openssl/err.h>
-
-#ifdef final
-// final is used as variable name in evp.h so we need to undef it before we
-// include it.
- #undef final
- #include <openssl/evp.h>
- #define final
-#else
- #include <openssl/evp.h>
-#endif
-
+#include <openssl/evp.h>
#include <string>
class Base64 {
public:
@@ -176,10 +166,11 @@ void LV2TestHost::Sequence::clear()
// Keep this to support atom extension from lv2 < 1.10
static inline LV2_Atom_Event*
_lv2_atom_sequence_append_event(LV2_Atom_Sequence* seq,
- uint32_t capacity,
- const LV2_Atom_Event* event)
+ uint32_t capacity,
+ const LV2_Atom_Event* event)
{
const uint32_t total_size = (uint32_t)sizeof(*event) + event->body.size;
+
if (capacity - seq->atom.size < total_size) {
return NULL;
}
@@ -205,7 +196,7 @@ void LV2TestHost::Sequence::addMidiNote(uint64_t pos,
MIDINoteEvent ev;
ev.event.time.frames = pos;// sample position
ev.event.body.type = map.map(map.handle, LV2_MIDI__MidiEvent);
- ev.event.body.size = sizeof(MIDINoteEvent);
+ ev.event.body.size = sizeof(ev.msg);
ev.msg[0] = note_on;
ev.msg[1] = key;