diff --git a/tests/45controller.tests b/tests/45controller.tests index 06c24b518..ee09c3692 100644 --- a/tests/45controller.tests +++ b/tests/45controller.tests @@ -125,3 +125,8 @@ END TEST "Dispatcher command queue" CommandQueue_test < +#include namespace proc { @@ -50,8 +55,9 @@ namespace test { using lib::time::Duration; using lib::time::Offset; using lib::Symbol; -// using util::isnil; + using util::isnil; using util::toString; + using std::string; namespace { // test fixture... @@ -129,25 +135,50 @@ namespace test { virtual void run (Arg) { + lumiera_interfaceregistry_init(); + lumiera::throwOnError(); + startDispatcher(); - perform_simpleInvocation(); - perform_messageInvocation(); - perform_massivelyParallel(); +// perform_simpleInvocation(); +// perform_messageInvocation(); +// perform_massivelyParallel(); stopDispatcher(); + + lumiera_interfaceregistry_destroy(); } + /** @test start the session loop thread, similar + * to what the »session subsystem« does + * @note we are _not_ actually starting the subsystem + * @see facade.cpp + */ void startDispatcher() { - UNIMPLEMENTED ("start the session loop thread"); + CHECK (not ProcDispatcher::instance().isRunning()); + + ProcDispatcher::instance().start ([&] (string* problemMessage) + { + CHECK (isnil (*problemMessage)); + thread_has_ended = true; + }); + + CHECK (ProcDispatcher::instance().isRunning()); + CHECK (not thread_has_ended); } + bool thread_has_ended{false}; void stopDispatcher() { - UNIMPLEMENTED ("stop the session loop thread"); + CHECK (ProcDispatcher::instance().isRunning()); + ProcDispatcher::instance().requestStop(); + + usleep(10000); + CHECK (not ProcDispatcher::instance().isRunning()); + CHECK (thread_has_ended); }