2009-02-09 17:32:38 -05:00
|
|
|
#include <cppunit/TestFixture.h>
|
|
|
|
#include <cppunit/extensions/HelperMacros.h>
|
|
|
|
|
2009-02-11 04:54:31 -05:00
|
|
|
#include <evoral/LibSMF.hpp>
|
2009-02-09 17:32:38 -05:00
|
|
|
|
2009-02-10 18:58:02 -05:00
|
|
|
#include "SequenceTest.hpp"
|
|
|
|
|
2009-02-09 17:32:38 -05:00
|
|
|
#include <sigc++/sigc++.h>
|
|
|
|
|
|
|
|
#include <cassert>
|
2009-02-10 18:58:02 -05:00
|
|
|
|
|
|
|
using namespace Evoral;
|
|
|
|
|
|
|
|
template<typename Time>
|
2009-02-11 04:54:31 -05:00
|
|
|
class TestSMF : public LibSMF<Time> {
|
2009-02-10 18:58:02 -05:00
|
|
|
public:
|
2009-02-11 12:59:33 -05:00
|
|
|
int open(const std::string& path) THROW_FILE_ERROR {
|
2009-02-11 04:54:31 -05:00
|
|
|
return LibSMF<Time>::open(path);
|
2009-02-10 18:58:02 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
int read_event(uint32_t* delta_t, uint32_t* size, uint8_t** buf) const {
|
2009-02-11 04:54:31 -05:00
|
|
|
return LibSMF<Time>::read_event(delta_t, size, buf);
|
2009-02-10 18:58:02 -05:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
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;
|
|
|
|
};
|