13
0
livetrax/libs/evoral/test/NoteTest.cc

34 lines
627 B
C++
Raw Normal View History

2020-01-16 14:58:28 -05:00
#include "NoteTest.h"
2019-09-05 08:08:31 -04:00
#include "temporal/beats.h"
#include "evoral/Note.h"
2016-12-04 18:49:56 -05:00
#include <stdlib.h>
CPPUNIT_TEST_SUITE_REGISTRATION (NoteTest);
using namespace Evoral;
2019-09-05 08:08:31 -04:00
typedef Temporal::Beats Time;
2016-12-04 18:49:56 -05:00
void
NoteTest::copyTest ()
{
2019-09-05 08:08:31 -04:00
Note<Time> a(0, Time(1.0), Time(2.0), 60, 0x40);
2016-12-04 18:49:56 -05:00
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 ()
{
2019-09-05 08:08:31 -04:00
Note<Time> a(0, Time(1.0), Time(2.0), 60, 0x40);
2016-12-04 18:49:56 -05:00
CPPUNIT_ASSERT_EQUAL (-1, a.id());
a.set_id(1234);
CPPUNIT_ASSERT_EQUAL (1234, a.id());
}