summaryrefslogtreecommitdiff
path: root/libs/evoral/test/NoteTest.cpp
blob: b96cd7c351a1fe8a33fd25634d9c7d2d0a90238e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "NoteTest.hpp"
#include "evoral/Note.hpp"
#include "evoral/Beats.hpp"
#include <stdlib.h>

CPPUNIT_TEST_SUITE_REGISTRATION (NoteTest);

using namespace Evoral;

typedef Beats Time;

void
NoteTest::copyTest ()
{
	Note<Time> a(0, Beats(1.0), Beats(2.0), 60, 0x40);
	Note<Time> b(a);
	CPPUNIT_ASSERT (a == b);

	// Broken due to event double free!
	// Note<Time> c(1, Beats(3.0), Beats(4.0), 61, 0x41);
	// c = a;
	// CPPUNIT_ASSERT (a == c);
}

void
NoteTest::idTest ()
{
	Note<Time> a(0, Beats(1.0), Beats(2.0), 60, 0x40);
	CPPUNIT_ASSERT_EQUAL (-1, a.id());

	a.set_id(1234);
	CPPUNIT_ASSERT_EQUAL (1234, a.id());
}