1 #include "NoteTest.h"
2 #include "temporal/beats.h"
3 #include "evoral/Note.h"
4 #include <stdlib.h>
5
6 CPPUNIT_TEST_SUITE_REGISTRATION (NoteTest);
7
8 using namespace Evoral;
9
10 typedef Temporal::Beats Time;
11
12 void
copyTest()13 NoteTest::copyTest ()
14 {
15 Note<Time> a(0, Time(1.0), Time(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
idTest()26 NoteTest::idTest ()
27 {
28 Note<Time> a(0, Time(1.0), Time(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 }
34