13
0

Patch from Tim Mayberry:

Remove redundant init and cleanup code from common test code

Calling PBD::EnumWriter::destroy means ARDOUR::init and setup_libpbd_enums need to be called again
to register types. If the call to EnumWriter::destroy is removed then ARDOUR::init and setup_libpbd_enums
no longer need to be called. EnumWriter::destroy should probably be added to ARDOUR::cleanup(or better yet PBD::cleanup)
and then called at the end of main. __attribute__ ((destructor)) could be used but that is not portable between


git-svn-id: svn://localhost/ardour2/branches/3.0@12578 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2012-06-06 11:58:15 +00:00
parent 46e448252f
commit 070e724190

View File

@ -6,8 +6,6 @@
#include "ardour/audioengine.h"
#include "test_needing_session.h"
extern void setup_libpbd_enums ();
using namespace std;
using namespace ARDOUR;
using namespace PBD;
@ -56,11 +54,8 @@ TestNeedingSession::setUp ()
string const test_session_path = "libs/ardour/test/test_session";
system (string_compose ("rm -rf %1", test_session_path).c_str());
init (false, true);
SessionEvent::create_per_thread_pool ("test", 512);
setup_libpbd_enums ();
test_receiver.listen_to (error);
test_receiver.listen_to (info);
test_receiver.listen_to (fatal);
@ -83,7 +78,6 @@ TestNeedingSession::tearDown ()
delete _session;
EnumWriter::destroy ();
MIDI::Manager::destroy ();
AudioEngine::destroy ();
}