From 070e72419093b7771ebaa83cc3c9f48a7a9e782f Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 6 Jun 2012 11:58:15 +0000 Subject: [PATCH] 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 --- libs/ardour/test/test_needing_session.cc | 6 ------ 1 file changed, 6 deletions(-) diff --git a/libs/ardour/test/test_needing_session.cc b/libs/ardour/test/test_needing_session.cc index 625d5735b2..70e3362f33 100644 --- a/libs/ardour/test/test_needing_session.cc +++ b/libs/ardour/test/test_needing_session.cc @@ -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 (); }