13
0

Fix compilation with --test.

Make midnam test suite pass again.

The Ardour test suite does not pass.  I commented out old crossfade stuff, but
I am not familiar enough with the parts that fail to fix it.  It might be a
good idea for someone to look into this.  Ideally we'd have the test integrated
into everyone's workflow, but they add quite a few files to compile...


git-svn-id: svn://localhost/ardour2/branches/3.0@13931 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2013-01-20 18:23:42 +00:00
parent fc7b4b7f62
commit fa8d0268eb
6 changed files with 22 additions and 16 deletions

View File

@ -14,7 +14,7 @@ cd build
libs='libs'
export LD_LIBRARY_PATH=$libs/audiographer:$libs/vamp-sdk:$libs/surfaces:$libs/surfaces/control_protocol:$libs/ardour:$libs/midi++2:$libs/pbd:$libs/rubberband:$libs/soundtouch:$libs/gtkmm2ext:$libs/appleutility:$libs/taglib:$libs/evoral:$libs/evoral/src/libsmf:$libs/timecode:/usr/local/lib:/usr/local/lib64:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$libs/audiographer:$libs/vamp-sdk:$libs/surfaces:$libs/surfaces/control_protocol:$libs/ardour:$libs/midi++2:$libs/pbd:$libs/rubberband:$libs/soundtouch:$libs/gtkmm2ext:$libs/appleutility:$libs/taglib:$libs/evoral:$libs/evoral/src/libsmf:$libs/timecode:$libs/libltc:/usr/local/lib:/usr/local/lib64:$LD_LIBRARY_PATH
export ARDOUR_CONFIG_PATH=$top:$top/gtk2_ardour:$libs/..:$libs/../gtk2_ardour
export ARDOUR_PANNER_PATH=$libs/panners/2in2out:$libs/panners/1in2out:$libs/panners/vbap

View File

@ -113,11 +113,13 @@ CombineRegionsTest::crossfadeTest1 ()
CPPUNIT_ASSERT_EQUAL (layer_t (0), _r[0]->layer ());
CPPUNIT_ASSERT_EQUAL (layer_t (1), _r[1]->layer ());
#if 0
/* Check that the right fades have been set up */
CPPUNIT_ASSERT_EQUAL (false, _ar[0]->fade_in_is_xfade ());
CPPUNIT_ASSERT_EQUAL (false, _ar[0]->fade_out_is_xfade ());
CPPUNIT_ASSERT_EQUAL (true, _ar[1]->fade_in_is_xfade ());
CPPUNIT_ASSERT_EQUAL (false, _ar[1]->fade_out_is_xfade ());
#endif
/* Check that the read comes back correctly */
check_crossfade1 ();
@ -217,12 +219,13 @@ CombineRegionsTest::crossfadeTest2 ()
CPPUNIT_ASSERT_EQUAL (layer_t (1), _r[0]->layer ());
CPPUNIT_ASSERT_EQUAL (layer_t (0), _r[1]->layer ());
#if 0
/* Check that the right fades have been set up */
CPPUNIT_ASSERT_EQUAL (false, _ar[0]->fade_in_is_xfade ());
CPPUNIT_ASSERT_EQUAL (true, _ar[0]->fade_out_is_xfade ());
CPPUNIT_ASSERT_EQUAL (false, _ar[1]->fade_in_is_xfade ());
CPPUNIT_ASSERT_EQUAL (false, _ar[1]->fade_out_is_xfade ());
#endif
/* Check that the read comes back correctly */
check_crossfade2 ();

View File

@ -39,7 +39,7 @@ PlaylistReadTest::setUp ()
_mbuf = new Sample[_N];
_gbuf = new float[_N];
_session->config.set_auto_xfade (false);
//_session->config.set_auto_xfade (false);
for (int i = 0; i < _N; ++i) {
_buf[i] = 0;
@ -97,17 +97,21 @@ PlaylistReadTest::overlappingReadTest ()
CPPUNIT_ASSERT_EQUAL (double (64), _ar[0]->_fade_out->back()->when);
_ar[0]->set_length (1024);
#if 0
/* Note: these are ordinary fades, not xfades */
CPPUNIT_ASSERT_EQUAL (false, _ar[0]->fade_in_is_xfade());
CPPUNIT_ASSERT_EQUAL (false, _ar[0]->fade_out_is_xfade());
#endif
_audio_playlist->add_region (_ar[1], 128);
_ar[1]->set_default_fade_in ();
_ar[1]->set_default_fade_out ();
#if 0
/* Note: these are ordinary fades, not xfades */
CPPUNIT_ASSERT_EQUAL (false, _ar[1]->fade_in_is_xfade());
CPPUNIT_ASSERT_EQUAL (false, _ar[1]->fade_out_is_xfade());
#endif
CPPUNIT_ASSERT_EQUAL (double (64), _ar[1]->_fade_in->back()->when);
CPPUNIT_ASSERT_EQUAL (double (64), _ar[1]->_fade_out->back()->when);

View File

@ -77,12 +77,12 @@ SequenceTest::iteratorSeekTest ()
bool on = true;
for (Sequence<Time>::const_iterator i = seq->begin(600); i != seq->end(); ++i) {
if (on) {
CPPUNIT_ASSERT(((MIDIEvent<Time>&)*i).is_note_on());
CPPUNIT_ASSERT(((const MIDIEvent<Time>&)*i).is_note_on());
CPPUNIT_ASSERT_EQUAL(i->time(), Time((num_notes + 6) * 100));
++num_notes;
on = false;
} else {
CPPUNIT_ASSERT(((MIDIEvent<Time>&)*i).is_note_off());
CPPUNIT_ASSERT(((const MIDIEvent<Time>&)*i).is_note_off());
on = true;
}
}

View File

@ -9,8 +9,7 @@ fi
# Make symlink to TakeFive.mid in build directory
cd ../../build/libs/midi++2
if [ "$1" == "debug" ]
then
if [ "$1" == "debug" ]; then
gdb ./run-tests
else
./run-tests

View File

@ -17,7 +17,7 @@ static string const prefix = "../../../patchfiles/";
void
MidnamTest::protools_patchfile_test()
{
XMLTree xmldoc(prefix + "ProtoolsPatchFile.midnam");
XMLTree xmldoc(prefix + "Roland_SC-88_Pro.midnam");
boost::shared_ptr<XMLSharedNodeList> result = xmldoc.find(
"//MIDINameDocument");
CPPUNIT_ASSERT(result->size() == 1);
@ -25,18 +25,18 @@ MidnamTest::protools_patchfile_test()
result = xmldoc.find("//ChannelNameSet");
CPPUNIT_ASSERT(result->size() == 2);
MIDINameDocument doc(prefix + "ProtoolsPatchFile.midnam");
MIDINameDocument doc(prefix + "Roland_SC-88_Pro.midnam");
CPPUNIT_ASSERT(doc.all_models().size() == 1);
CPPUNIT_ASSERT(doc.author().find("Mark of the Unicorn") == 0);
const string model = doc.all_models().front();
const string model = *doc.all_models().begin();
CPPUNIT_ASSERT_EQUAL(string("SC-88 Pro"), model);
boost::shared_ptr<MasterDeviceNames> masterDeviceNames =
doc.master_device_names_by_model().find(model)->second;
CPPUNIT_ASSERT_EQUAL(string("Roland"), masterDeviceNames->manufacturer());
string modename = masterDeviceNames->custom_device_mode_names().front();
CPPUNIT_ASSERT_EQUAL(string("Mode 1"), modename);
CPPUNIT_ASSERT_EQUAL(string("Default"), modename);
boost::shared_ptr<CustomDeviceMode> mode =
masterDeviceNames->custom_device_mode_by_name(modename);
@ -72,7 +72,7 @@ MidnamTest::protools_patchfile_test()
boost::shared_ptr<PatchBank> bank = banks1.front();
CPPUNIT_ASSERT_EQUAL(string("Piano"), bank->name());
const PatchBank::PatchNameList& plist1 = bank->patch_name_list();
const PatchNameList& plist1 = bank->patch_name_list();
CPPUNIT_ASSERT(plist1.size() == 110);
bank = banks2.front();
@ -84,7 +84,7 @@ MidnamTest::protools_patchfile_test()
void
MidnamTest::yamaha_PSRS900_patchfile_test()
{
XMLTree xmldoc(prefix + "Yamaha-PSR-S900.midnam");
XMLTree xmldoc(prefix + "Yamaha_PSR-S900.midnam");
boost::shared_ptr<XMLSharedNodeList> result = xmldoc.find(
"//MIDINameDocument");
CPPUNIT_ASSERT(result->size() == 1);
@ -92,15 +92,15 @@ MidnamTest::yamaha_PSRS900_patchfile_test()
result = xmldoc.find("//ChannelNameSet");
CPPUNIT_ASSERT(result->size() == 3);
MIDINameDocument doc(prefix + "Yamaha-PSR-S900.midnam");
MIDINameDocument doc(prefix + "Yamaha_PSR-S900.midnam");
CPPUNIT_ASSERT(doc.all_models().size() == 1);
CPPUNIT_ASSERT(doc.author().find("Hans Baier") == 0);
const string model = doc.all_models().front();
const string model = *doc.all_models().begin();
CPPUNIT_ASSERT_EQUAL(string("PSR-S900"), model);
boost::shared_ptr<MasterDeviceNames> masterDeviceNames =
doc.master_device_names_by_model().find(model)->second;
CPPUNIT_ASSERT_EQUAL(string("YAMAHA"), masterDeviceNames->manufacturer());
CPPUNIT_ASSERT_EQUAL(string("Yamaha"), masterDeviceNames->manufacturer());
const MasterDeviceNames::CustomDeviceModeNames& modes = masterDeviceNames->custom_device_mode_names();
CPPUNIT_ASSERT(masterDeviceNames->custom_device_mode_names().size() == 3);