diff --git a/libs/evoral/src/Sequence.cpp b/libs/evoral/src/Sequence.cpp index cc102f6c22..dd597aa5fa 100644 --- a/libs/evoral/src/Sequence.cpp +++ b/libs/evoral/src/Sequence.cpp @@ -219,6 +219,8 @@ Sequence::const_iterator::const_iterator(const Sequence& seq, T t) debugout << " : " << hex << (int)((MIDIEvent*)_event.get())->type(); debugout << " @ " << _event->time() << endl; } + + assert(_event && _event->size() > 0); //assert(_is_end || (_event->buffer() && _event->buffer()[0] != '\0')); } @@ -240,7 +242,7 @@ Sequence::const_iterator::operator++() } debugout << "Iterator ++" << endl; - assert(_event->buffer() && _event->size() > 0); + assert(_event && _event->buffer() && _event->size() > 0); const MIDIEvent& ev = *((MIDIEvent*)_event.get()); diff --git a/libs/evoral/test/sequence.cpp b/libs/evoral/test/sequence.cpp index 1398274841..82ea71d939 100644 --- a/libs/evoral/test/sequence.cpp +++ b/libs/evoral/test/sequence.cpp @@ -13,6 +13,7 @@ SequenceTest::createTest (void) CPPUNIT_ASSERT(seq->notes().begin() == seq->notes().end()); } + void SequenceTest::preserveEventOrderingTest (void) { @@ -50,6 +51,7 @@ SequenceTest::preserveEventOrderingTest (void) seq->end_write(); TestSink