OSC: Add system osc preset directory
[ardour.git] / libs / evoral / test / SMFTest.hpp
index 77ccb545725df1b3871de172848dc2efc74261c0..fc58ede9353cd424ff4cf884a1c1775faa934b22 100644 (file)
@@ -1,16 +1,16 @@
 /* This file is part of Evoral.
  * Copyright(C) 2000-2008 Paul Davis
  * Author: Hans Baier
- * 
+ *
  * Evoral is free software; you can redistribute it and/or modify it under the
  * terms of the GNU General Public License as published by the Free Software
  * Foundation; either version 2 of the License, or(at your option) any later
  * version.
- * 
+ *
  * Evoral is distributed in the hope that it will be useful, but WITHOUT ANY
  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
@@ -21,6 +21,7 @@
 #include <sigc++/sigc++.h>
 #include <cppunit/TestFixture.h>
 #include <cppunit/extensions/HelperMacros.h>
+#include "evoral/types.hpp"
 #include "evoral/SMF.hpp"
 #include "SequenceTest.hpp"
 
@@ -29,18 +30,19 @@ using namespace Evoral;
 class TestSMF : public SMF {
 public:
        std::string path() const { return _path; }
-       
+
        int open(const std::string& path) THROW_FILE_ERROR {
                _path = path;
                return SMF::open(path);
        }
-       
+
        void close() THROW_FILE_ERROR {
                return SMF::close();
        }
-       
+
        int read_event(uint32_t* delta_t, uint32_t* size, uint8_t** buf) const {
-               return SMF::read_event(delta_t, size, buf);
+               event_id_t id;
+               return SMF::read_event(delta_t, size, buf, &id);
        }
 
 private:
@@ -49,31 +51,33 @@ private:
 
 class SMFTest : public CppUnit::TestFixture
 {
-    CPPUNIT_TEST_SUITE(SMFTest);
-    CPPUNIT_TEST(createNewFileTest);
-    CPPUNIT_TEST(takeFiveTest);
-    CPPUNIT_TEST_SUITE_END();
+       CPPUNIT_TEST_SUITE(SMFTest);
+       CPPUNIT_TEST(createNewFileTest);
+       CPPUNIT_TEST(takeFiveTest);
+       CPPUNIT_TEST(writeTest);
+       CPPUNIT_TEST_SUITE_END();
 
-    public:
-       typedef double Time;
-               
-        void setUp() { 
-           type_map = new DummyTypeMap();
-           assert(type_map);
-           seq = new MySequence<Time>(*type_map);
-           assert(seq);
-        }
-        
-        void tearDown() {
-               delete seq;
-               delete type_map;
-        }
+public:
+       typedef Evoral::Beats Time;
 
-        void createNewFileTest();
-        void takeFiveTest();
+       void setUp() {
+               type_map = new DummyTypeMap();
+               assert(type_map);
+               seq = new MySequence<Time>(*type_map);
+               assert(seq);
+       }
 
-    private:
-               DummyTypeMap*     type_map;
-               MySequence<Time>* seq;
+       void tearDown() {
+               delete seq;
+               delete type_map;
+       }
+
+       void createNewFileTest();
+       void takeFiveTest();
+       void writeTest();
+
+private:
+       DummyTypeMap*     type_map;
+       MySequence<Time>* seq;
 };