new header file for superclock stuff
[ardour.git] / libs / evoral / test / NoteTest.cpp
1 #include "NoteTest.hpp"
2 #include "evoral/Note.hpp"
3 #include "evoral/Beats.hpp"
4 #include <stdlib.h>
5
6 CPPUNIT_TEST_SUITE_REGISTRATION (NoteTest);
7
8 using namespace Evoral;
9
10 typedef Beats Time;
11
12 void
13 NoteTest::copyTest ()
14 {
15         Note<Time> a(0, Beats(1.0), Beats(2.0), 60, 0x40);
16         Note<Time> b(a);
17         CPPUNIT_ASSERT (a == b);
18
19         // Broken due to event double free!
20         // Note<Time> c(1, Beats(3.0), Beats(4.0), 61, 0x41);
21         // c = a;
22         // CPPUNIT_ASSERT (a == c);
23 }
24
25 void
26 NoteTest::idTest ()
27 {
28         Note<Time> a(0, Beats(1.0), Beats(2.0), 60, 0x40);
29         CPPUNIT_ASSERT_EQUAL (-1, a.id());
30
31         a.set_id(1234);
32         CPPUNIT_ASSERT_EQUAL (1234, a.id());
33 }