stuff-from-scratch/test/audio/TestMidiReader.cpp

32 lines
624 B
C++
Raw Normal View History

2021-05-23 20:02:38 +00:00
#include "MidiReader.h"
#include "TestCase.h"
#include "TestCaseRunner.h"
#include <memory>
#include <string>
#include <iostream>
class TestReadMidi : public TestCase
{
public:
bool Run() override
{
MidiReader reader;
reader.Read("/home/jmsgrogan/Downloads/test.mid");
auto document = reader.GetDocument();
std::cout << document->Serialize() << std::endl;
return true;
}
};
int main()
{
TestCaseRunner runner;
runner.AddTestCase("TestReadMidi", std::make_unique<TestReadMidi>());
const auto testsPassed = runner.Run();
return testsPassed ? 0 : -1;
}