13
0
livetrax/libs/evoral/test/SMFTest.hpp
Hans Baier 947077c12e * introduced dependency: libsmf-1.2
* extracted Interface from SMF: StandardMIDIFile
* first implementation of StandardMIDIFile based on libsmf that passes basic test


git-svn-id: svn://localhost/ardour2/branches/3.0@4529 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-11 09:54:31 +00:00

54 lines
1.1 KiB
C++

#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
#include <evoral/LibSMF.hpp>
#include "SequenceTest.hpp"
#include <sigc++/sigc++.h>
#include <cassert>
using namespace Evoral;
template<typename Time>
class TestSMF : public LibSMF<Time> {
public:
int open(const std::string& path) {
return LibSMF<Time>::open(path);
}
int read_event(uint32_t* delta_t, uint32_t* size, uint8_t** buf) const {
return LibSMF<Time>::read_event(delta_t, size, buf);
}
};
class SMFTest : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE (SMFTest);
CPPUNIT_TEST (takeFiveTest);
CPPUNIT_TEST_SUITE_END ();
public:
typedef double Time;
void setUp (void) {
type_map = new DummyTypeMap();
assert(type_map);
seq = new MySequence<Time>(*type_map, 0);
assert(seq);
}
void tearDown (void) {
delete seq;
delete type_map;
}
void takeFiveTest (void);
private:
DummyTypeMap* type_map;
MySequence<Time>* seq;
};