From fe10ab92dc619e52311783ecfffa8b838b545fe2 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Fri, 30 Mar 2018 23:55:42 +0200 Subject: [PATCH] DI: adjust codebase to the new DependInject configuration API --- research/try.cpp | 10 ++++++---- src/backend/engine/engine-config.h | 2 +- src/common/query/defs-manager-impl.hpp | 9 ++++++++- src/common/query/defs-manager.hpp | 8 ++++++++ src/gui/demo-gui-roundtrip.cpp | 4 ++-- src/include/config-facade.h | 2 +- src/proc/asset/db.hpp | 3 ++- src/proc/assetmanager.hpp | 6 +++--- src/proc/config-resolver.cpp | 9 +++++---- src/proc/control/proc-dispatcher.cpp | 3 +++ src/proc/control/proc-dispatcher.hpp | 5 ++++- src/proc/control/stypemanager.hpp | 4 ++-- src/proc/engine/diagnostic-buffer-provider.hpp | 2 +- .../mobject/session/dummy-session-connection.hpp | 2 +- src/proc/mobject/session/query/fake-configrules.hpp | 4 ++-- src/proc/mobject/session/scope-locator.hpp | 2 +- src/proc/mobject/session/sess-manager-impl.hpp | 2 +- src/proc/play/output-director.hpp | 2 +- tests/core/backend/media-access-mock-test.cpp | 5 ++--- tests/core/backend/media-access-mock.cpp | 12 ++++++++---- tests/core/backend/media-access-mock.hpp | 10 ++++------ tests/core/proc/asset/create-asset-test.cpp | 6 ++++-- tests/core/proc/asset/dependent-assets-test.cpp | 7 ++++--- tests/core/proc/asset/identity-of-assets-test.cpp | 6 ++++-- tests/core/proc/asset/make-clip-test.cpp | 6 ++++-- tests/core/proc/asset/ordering-of-assets-test.cpp | 6 ++++-- .../core/proc/mobject/builder/builder-tool-test.cpp | 6 ++++-- tests/core/proc/mobject/mobject-interface-test.cpp | 6 ++++-- tests/core/proc/mobject/mobject-ref-test.cpp | 6 ++++-- tests/core/proc/mobject/placement-hierarchy-test.cpp | 8 +++++--- tests/core/proc/mobject/session/testclip.cpp | 10 ++++++---- 31 files changed, 109 insertions(+), 64 deletions(-) diff --git a/research/try.cpp b/research/try.cpp index f3251cac2..a034e6bdf 100644 --- a/research/try.cpp +++ b/research/try.cpp @@ -102,15 +102,17 @@ main (int, char**) Depend mystery; - cout << microbenchmark<1> ([&]() + thread_local int64_t cnt = 0; + + cout << microbenchmark<8> ([&]() { - 0 == mystery().readMe(); + cnt += mystery().readMe(); } - ,5000000000) + ,50000000) << endl; LifecycleHook::trigger (ON_GLOBAL_SHUTDOWN); -// cout << "\n.gulp.\n"; + cout << "\n.gulp.\n"; return 0; } diff --git a/src/backend/engine/engine-config.h b/src/backend/engine/engine-config.h index 89df108a9..4560c5556 100644 --- a/src/backend/engine/engine-config.h +++ b/src/backend/engine/engine-config.h @@ -69,7 +69,7 @@ namespace engine { EngineConfig(); ~EngineConfig(); - friend class lib::DependencyFactory; + friend class lib::DependencyFactory; public: /** access point to the Engine Interface. diff --git a/src/common/query/defs-manager-impl.hpp b/src/common/query/defs-manager-impl.hpp index ab4f6f01a..d7e02b283 100644 --- a/src/common/query/defs-manager-impl.hpp +++ b/src/common/query/defs-manager-impl.hpp @@ -46,6 +46,8 @@ #include "common/query/defs-manager.hpp" #include "common/query/defs-registry.hpp" #include "common/config-rules.hpp" +#include "proc/mobject/session/query/fake-configrules.hpp" +#include "lib/depend-inject.hpp" #include "lib/format-string.hpp" #include "lib/error.hpp" @@ -66,7 +68,12 @@ namespace query { DefsManager::DefsManager () throw() : defsRegistry_(new DefsRegistry) { - TODO ("setup basic technical defaults of the session?"); + INFO (session, "Configure technical defaults of the session."); + + // PLANNED: use an embedded Prolog-System or similar rules engine. + // For the time being, we use preconfigured fake answers for some common Config-Queries + lib::DependInject::useSingleton(); + } diff --git a/src/common/query/defs-manager.hpp b/src/common/query/defs-manager.hpp index a61817bfb..cc9e55930 100644 --- a/src/common/query/defs-manager.hpp +++ b/src/common/query/defs-manager.hpp @@ -85,6 +85,14 @@ ** - for sake of completeness, we can also require a specific element to ** be purged from knowledge ** + ** ## Fake implementation + ** As of 2018, the Lumiera project still has to reach the goal of a complete + ** running engine; we are proceeding with partial integrations for the time being. + ** And we postpone advanced topics, like integration of an actual rules solver + ** to future milestones. Meanwhile, we use a [fake implementation](\ref MockConfigRules) + ** with preconfigured, hard-wired "answers" to some frequently encountered standard queries. + ** This Fake implementation is configured and instantiated by the [Defaults Manager](\ref DefsManager) + ** ** @see DefsManager_test ** @see DefsManagerImpl_test ** diff --git a/src/gui/demo-gui-roundtrip.cpp b/src/gui/demo-gui-roundtrip.cpp index 2bd2181cc..f22834533 100644 --- a/src/gui/demo-gui-roundtrip.cpp +++ b/src/gui/demo-gui-roundtrip.cpp @@ -30,7 +30,7 @@ ** - and sends a "mark" message towards some UI demo widget ** - which in turn displays the mark text ** - ** @todo WIP as of 8/20176 ////////////////////////////////////////////////////////////////////////TICKET #1099 + ** @todo WIP as of 8/2017 ////////////////////////////////////////////////////////////////////////TICKET #1099 ** ** @see CallQueue_test ** @see notification-service.hpp @@ -84,7 +84,7 @@ namespace gui { DemoGuiRoundtrip(); ~DemoGuiRoundtrip(); - friend class lib::DependencyFactory; + friend class lib::DependencyFactory; public: /** access point to set up the scaffolding. diff --git a/src/include/config-facade.h b/src/include/config-facade.h index 173af49d0..b00b645f0 100644 --- a/src/include/config-facade.h +++ b/src/include/config-facade.h @@ -81,7 +81,7 @@ namespace lumiera { private: Config(); ~Config(); - friend class lib::DependencyFactory; + friend class lib::DependencyFactory; }; diff --git a/src/proc/asset/db.hpp b/src/proc/asset/db.hpp index 1e94dac01..22a729db4 100644 --- a/src/proc/asset/db.hpp +++ b/src/proc/asset/db.hpp @@ -35,6 +35,7 @@ #include "lib/sync.hpp" #include "lib/error.hpp" #include "proc/asset.hpp" +#include "lib/depend-inject.hpp" #include #include @@ -109,7 +110,7 @@ namespace asset { clear(); } - friend class lib::DependencyFactory; + friend class lib::DependencyFactory; public: diff --git a/src/proc/assetmanager.hpp b/src/proc/assetmanager.hpp index 61d691299..08f6e6244 100644 --- a/src/proc/assetmanager.hpp +++ b/src/proc/assetmanager.hpp @@ -100,7 +100,7 @@ namespace asset { /** deregister and evict all known Assets. * @note the actual object instances are managed by reference count, - * i.e. typically the Assets will be kept alive by MObjects from the sesison + * i.e. typically the Assets will be kept alive by MObjects from the session * @warning unsure if this design is sane. Asset subsystem needs a rework ////////////////////////////TICKET #691 * @todo verify this actually works, especially with session shutdown ////////////////////////////TICKET #154 */ @@ -124,9 +124,9 @@ namespace asset { friend Asset::Asset (Asset::Ident const& idi); - AssetManager (); + AssetManager(); - friend class lib::DependencyFactory; + friend class lib::DependencyFactory; }; diff --git a/src/proc/config-resolver.cpp b/src/proc/config-resolver.cpp index ffd865fb3..12e341d9f 100644 --- a/src/proc/config-resolver.cpp +++ b/src/proc/config-resolver.cpp @@ -31,16 +31,17 @@ #include "lib/error.hpp" #include "proc/config-resolver.hpp" -#include "proc/mobject/session/query/fake-configrules.hpp" namespace proc { - using lib::buildSingleton; - /** Singleton factory instance, configured with the actual implementation type. */ - lib::Depend ConfigResolver::instance (buildSingleton()); + /** Singleton factory instance, configured with the actual implementation type. + * @see DefsManager::DefsManager() + * @see defs-manager-impl.hpp + */ + lib::Depend ConfigResolver::instance; } // namespace proc diff --git a/src/proc/control/proc-dispatcher.cpp b/src/proc/control/proc-dispatcher.cpp index 5554cce84..fced93dd6 100644 --- a/src/proc/control/proc-dispatcher.cpp +++ b/src/proc/control/proc-dispatcher.cpp @@ -326,6 +326,9 @@ namespace control { /* ======== ProcDispatcher implementation ======== */ + ProcDispatcher::ProcDispatcher() { } + ProcDispatcher::~ProcDispatcher() { } + /** starting the ProcDispatcher means to start the session subsystem. * @return `false` when _starting_ failed since it is already running... * @remark this function implements the start operation for the »session subsystem«. diff --git a/src/proc/control/proc-dispatcher.hpp b/src/proc/control/proc-dispatcher.hpp index 7ffbfc209..66381e2b9 100644 --- a/src/proc/control/proc-dispatcher.hpp +++ b/src/proc/control/proc-dispatcher.hpp @@ -87,7 +87,6 @@ namespace control { unique_ptr runningLoop_; bool active_{false}; - public: static lib::Depend instance; @@ -104,6 +103,10 @@ namespace control { private: void endRunningLoopState(); + + ~ProcDispatcher(); + ProcDispatcher(); + friend class lib::DependencyFactory; }; diff --git a/src/proc/control/stypemanager.hpp b/src/proc/control/stypemanager.hpp index 1706aece5..67d812fd9 100644 --- a/src/proc/control/stypemanager.hpp +++ b/src/proc/control/stypemanager.hpp @@ -86,11 +86,11 @@ namespace control { STypeManager() ; ~STypeManager(); - friend class lib::DependencyFactory; + friend class lib::DependencyFactory; /** Lifecycle: reset all type registration information * to the generic pristine default state. This includes - * hard wired defaults and defauls provided by type plugins, but + * hard wired defaults and defaults provided by type plugins, but * excludes everything added by the session */ void reset() ; diff --git a/src/proc/engine/diagnostic-buffer-provider.hpp b/src/proc/engine/diagnostic-buffer-provider.hpp index f2bbc87b6..7e74c77da 100644 --- a/src/proc/engine/diagnostic-buffer-provider.hpp +++ b/src/proc/engine/diagnostic-buffer-provider.hpp @@ -73,7 +73,7 @@ namespace engine { DiagnosticBufferProvider(); ~DiagnosticBufferProvider(); - friend class lib::DependencyFactory; + friend class lib::DependencyFactory; public: /** build a new Diagnostic Buffer Provider instance, diff --git a/src/proc/mobject/session/dummy-session-connection.hpp b/src/proc/mobject/session/dummy-session-connection.hpp index 8f1eeb9a8..f83d47741 100644 --- a/src/proc/mobject/session/dummy-session-connection.hpp +++ b/src/proc/mobject/session/dummy-session-connection.hpp @@ -71,7 +71,7 @@ namespace session { DummySessionConnection(); ~DummySessionConnection(); - friend class lib::DependencyFactory; + friend class lib::DependencyFactory; public: /** access point to set up the scaffolding. diff --git a/src/proc/mobject/session/query/fake-configrules.hpp b/src/proc/mobject/session/query/fake-configrules.hpp index b74c18993..d00f33f86 100644 --- a/src/proc/mobject/session/query/fake-configrules.hpp +++ b/src/proc/mobject/session/query/fake-configrules.hpp @@ -289,8 +289,8 @@ namespace session { > { protected: - MockConfigRules (); ///< to be used only by the singleton factory - friend class lib::DependencyFactory; + MockConfigRules (); ///< to be used only by the singleton factory + friend class lib::DependencyFactory; virtual ~MockConfigRules() {} diff --git a/src/proc/mobject/session/scope-locator.hpp b/src/proc/mobject/session/scope-locator.hpp index 0cd253c2f..735ab2699 100644 --- a/src/proc/mobject/session/scope-locator.hpp +++ b/src/proc/mobject/session/scope-locator.hpp @@ -99,7 +99,7 @@ namespace session { protected: ScopeLocator(); - friend class lib::DependencyFactory; + friend class lib::DependencyFactory; private: lumiera::QueryResolver const& theResolver(); diff --git a/src/proc/mobject/session/sess-manager-impl.hpp b/src/proc/mobject/session/sess-manager-impl.hpp index 094d43bd7..5e8450b5c 100644 --- a/src/proc/mobject/session/sess-manager-impl.hpp +++ b/src/proc/mobject/session/sess-manager-impl.hpp @@ -66,7 +66,7 @@ namespace session { unique_ptr lifecycle_; SessManagerImpl() throw(); - friend class lib::DependencyFactory; + friend class lib::DependencyFactory; ~SessManagerImpl() ; diff --git a/src/proc/play/output-director.hpp b/src/proc/play/output-director.hpp index 56a196e77..10069b74a 100644 --- a/src/proc/play/output-director.hpp +++ b/src/proc/play/output-director.hpp @@ -88,7 +88,7 @@ namespace play { private: OutputDirector() ; ~OutputDirector() ; - friend class lib::DependencyFactory; + friend class lib::DependencyFactory; void bringDown (SigTerm completedSignal); diff --git a/tests/core/backend/media-access-mock-test.cpp b/tests/core/backend/media-access-mock-test.cpp index 707d865cb..954d8612a 100644 --- a/tests/core/backend/media-access-mock-test.cpp +++ b/tests/core/backend/media-access-mock-test.cpp @@ -35,7 +35,7 @@ #include -using lib::test::Depend4Test; +using lib::DependInject; using lib::Literal; using std::string; @@ -46,7 +46,6 @@ namespace test { - /****************************************************************************//** * @test inject a Mock object replacing the backend_interface::MediaAccessFacade. * Verify if the Mock object behaves as expected when calling the Facade. @@ -57,7 +56,7 @@ namespace test { virtual void run(Arg) { - Depend4Test within_this_scope; + DependInject::Local useMockMedia; queryScenario ("test-1"); queryScenario ("test-2"); diff --git a/tests/core/backend/media-access-mock.cpp b/tests/core/backend/media-access-mock.cpp index 1e6e92855..fac990051 100644 --- a/tests/core/backend/media-access-mock.cpp +++ b/tests/core/backend/media-access-mock.cpp @@ -26,6 +26,7 @@ ** information from the data backend. The Mock implementation instead holds ** a map of fixed response which will be delivered when querying some magic ** filenames. + ** @todo this facility was occasionally used until 2011, yet never really completed ** ** @see mediaaccessmocktest.cpp validating the Mock ** @see MediaAccessFactory the real thing @@ -83,7 +84,9 @@ namespace test { private: static int _i_; - ChanHandle genH() + + ChanHandle + genH() { return reinterpret_cast (++_i_); } @@ -111,7 +114,8 @@ namespace test { // ----------------------------------------------------------------------TESTCASES } - bool known (string key) + bool + known (string key) { const_iterator i = find (key); return (i != end()); @@ -130,7 +134,7 @@ namespace test { { if (isnil (name)) throw Invalid ("empty filename passed to MediaAccessFacade."); - + if (!testCases().known(name)) throw Invalid ("unable to use media file \""+name+"\"." "Hint: you're using a test-mock file access, " @@ -145,7 +149,7 @@ namespace test { { Response const& res (*reinterpret_cast (&h)); - if (res.channels.size() <= chanNo) + if (res.channels.size() <= chanNo) return NULLResponse; else return res.channels[chanNo]; diff --git a/tests/core/backend/media-access-mock.hpp b/tests/core/backend/media-access-mock.hpp index f44e9060e..4c69d8fb0 100644 --- a/tests/core/backend/media-access-mock.hpp +++ b/tests/core/backend/media-access-mock.hpp @@ -45,13 +45,11 @@ namespace test { * Mock implementation of the MediaAccessFacade. * Provides preconfigured responses for some Test-Filenames. */ - class MediaAccessMock : public MediaAccessFacade + class MediaAccessMock + : public MediaAccessFacade { - MediaDesc& queryFile (string const& name) const; - ChanDesc queryChannel (MediaDesc&, uint chanNo) const; - - public: - typedef MediaAccessFacade ServiceInterface; + MediaDesc& queryFile (string const& name) const override; + ChanDesc queryChannel (MediaDesc&, uint chanNo) const override; }; diff --git a/tests/core/proc/asset/create-asset-test.cpp b/tests/core/proc/asset/create-asset-test.cpp index df6c30e00..c81140b08 100644 --- a/tests/core/proc/asset/create-asset-test.cpp +++ b/tests/core/proc/asset/create-asset-test.cpp @@ -37,7 +37,6 @@ #include "backend/media-access-mock.hpp" #include "lib/depend-inject.hpp" -using lib::test::Depend4Test; using util::isnil; using std::string; @@ -45,6 +44,9 @@ using std::string; namespace proc { namespace asset{ namespace test { + + using MediaAccessMock = lib::DependInject + ::Local; @@ -57,7 +59,7 @@ namespace test { { virtual void run(Arg arg) { - Depend4Test within_this_scope; + MediaAccessMock useMockMedia; createMedia(); factoryVariants(); diff --git a/tests/core/proc/asset/dependent-assets-test.cpp b/tests/core/proc/asset/dependent-assets-test.cpp index a132fb2c5..5ef0e3beb 100644 --- a/tests/core/proc/asset/dependent-assets-test.cpp +++ b/tests/core/proc/asset/dependent-assets-test.cpp @@ -34,16 +34,17 @@ #include "proc/asset/clip.hpp" #include "lib/util.hpp" -using lib::test::Depend4Test; using util::contains; using util::isnil; - namespace proc { namespace asset{ namespace test { + using MediaAccessMock = lib::DependInject + ::Local; + @@ -199,7 +200,7 @@ namespace test { */ void checkRealAssetDependencyRegistration () { - Depend4Test within_this_scope; + MediaAccessMock useMockMedia; // -----Media and Clip-------------------------------- typedef lib::P PM; diff --git a/tests/core/proc/asset/identity-of-assets-test.cpp b/tests/core/proc/asset/identity-of-assets-test.cpp index 69dd322d2..ff2e3c40d 100644 --- a/tests/core/proc/asset/identity-of-assets-test.cpp +++ b/tests/core/proc/asset/identity-of-assets-test.cpp @@ -37,7 +37,6 @@ #include "backend/media-access-mock.hpp" #include "lib/depend-inject.hpp" -using lib::test::Depend4Test; using util::isnil; using std::string; @@ -46,6 +45,9 @@ namespace proc { namespace asset{ namespace test { + using MediaAccessMock = lib::DependInject + ::Local; + @@ -76,7 +78,7 @@ namespace test { */ void createDuplicate() { - Depend4Test within_this_scope; + MediaAccessMock useMockMedia; PM mm1 = asset::Media::create ("test-1.mov", VIDEO); diff --git a/tests/core/proc/asset/make-clip-test.cpp b/tests/core/proc/asset/make-clip-test.cpp index a9a0644e7..16813e70a 100644 --- a/tests/core/proc/asset/make-clip-test.cpp +++ b/tests/core/proc/asset/make-clip-test.cpp @@ -37,7 +37,6 @@ #include "backend/media-access-mock.hpp" #include "lib/depend-inject.hpp" -using lib::test::Depend4Test; using util::contains; using util::isnil; using std::string; @@ -48,6 +47,9 @@ namespace proc { namespace asset{ namespace test { + using MediaAccessMock = lib::DependInject + ::Local; + @@ -63,7 +65,7 @@ namespace test { virtual void run (Arg) { - Depend4Test within_this_scope; + MediaAccessMock useMockMedia; PM mm = asset::Media::create("test-1", VIDEO); diff --git a/tests/core/proc/asset/ordering-of-assets-test.cpp b/tests/core/proc/asset/ordering-of-assets-test.cpp index 042d579b1..a24fdf05c 100644 --- a/tests/core/proc/asset/ordering-of-assets-test.cpp +++ b/tests/core/proc/asset/ordering-of-assets-test.cpp @@ -36,7 +36,6 @@ #include "backend/media-access-mock.hpp" #include "lib/depend-inject.hpp" -using lib::test::Depend4Test; using util::isnil; using std::string; @@ -45,6 +44,9 @@ namespace proc { namespace asset{ namespace test { + using MediaAccessMock = lib::DependInject + ::Local; + @@ -65,7 +67,7 @@ namespace test { { virtual void run(Arg) { - Depend4Test within_this_scope; + MediaAccessMock useMockMedia; Asset::Ident key1("test-1", Category(AUDIO), "ichthyo", 5); diff --git a/tests/core/proc/mobject/builder/builder-tool-test.cpp b/tests/core/proc/mobject/builder/builder-tool-test.cpp index a7bb23071..1dc26415e 100644 --- a/tests/core/proc/mobject/builder/builder-tool-test.cpp +++ b/tests/core/proc/mobject/builder/builder-tool-test.cpp @@ -50,8 +50,10 @@ namespace test { using session::Clip; using session::AbstractMO; - using lib::test::Depend4Test; using namespace mobject::test; + + using MediaAccessMock = lib::DependInject + ::Local; @@ -115,7 +117,7 @@ namespace test { virtual void run(Arg) { - Depend4Test within_this_scope; + MediaAccessMock useMockMedia; TestTool t1; diff --git a/tests/core/proc/mobject/mobject-interface-test.cpp b/tests/core/proc/mobject/mobject-interface-test.cpp index eab0deb4b..62165e3ab 100644 --- a/tests/core/proc/mobject/mobject-interface-test.cpp +++ b/tests/core/proc/mobject/mobject-interface-test.cpp @@ -55,7 +55,6 @@ namespace test { // using lib::test::showSizeof; using lib::Symbol; - using lib::test::Depend4Test; using lib::time::Duration; using lib::time::FSecs; using lib::time::Time; @@ -64,6 +63,9 @@ namespace test { // using session::Clip; // using session::PMedia; + using MediaAccessMock = lib::DependInject + ::Local; + using namespace mobject::test; typedef TestPlacement PDummy; @@ -85,7 +87,7 @@ namespace test { virtual void run (Arg) { - Depend4Test within_this_scope; + MediaAccessMock useMockMedia; PMO testClip1 = asset::Media::create("test-1", asset::VIDEO)->createClip(); diff --git a/tests/core/proc/mobject/mobject-ref-test.cpp b/tests/core/proc/mobject/mobject-ref-test.cpp index 6014bb107..5bd99dcb1 100644 --- a/tests/core/proc/mobject/mobject-ref-test.cpp +++ b/tests/core/proc/mobject/mobject-ref-test.cpp @@ -44,7 +44,6 @@ #include "lib/util.hpp" -using lib::test::Depend4Test; using lib::test::showSizeof; using lib::time::Duration; using lib::time::FSecs; @@ -84,6 +83,9 @@ namespace test { using session::SessionServiceMockIndex; using session::PPIdx; + using MediaAccessMock = lib::DependInject + ::Local; + /***********************************************************************//** @@ -107,7 +109,7 @@ namespace test { virtual void run (Arg) { - Depend4Test within_this_scope; + MediaAccessMock useMockMedia; // create data simulating a "Session" diff --git a/tests/core/proc/mobject/placement-hierarchy-test.cpp b/tests/core/proc/mobject/placement-hierarchy-test.cpp index 654238d0e..785d4f2f4 100644 --- a/tests/core/proc/mobject/placement-hierarchy-test.cpp +++ b/tests/core/proc/mobject/placement-hierarchy-test.cpp @@ -39,7 +39,6 @@ using lib::HashIndexed; -using lib::test::Depend4Test; namespace proc { @@ -52,6 +51,9 @@ namespace test { using namespace mobject::test; using lumiera::error::LUMIERA_ERROR_ASSERTION; + using MediaAccessMock = lib::DependInject + ::Local; + /***********************************************************************************//** * @test creating placements specifically typed, forming an hierarchy of placement types @@ -65,9 +67,9 @@ namespace test { { virtual void - run (Arg) + run (Arg) { - Depend4Test within_this_scope; + MediaAccessMock useMockMedia; typedef Placement PMObj; diff --git a/tests/core/proc/mobject/session/testclip.cpp b/tests/core/proc/mobject/session/testclip.cpp index f6a06f592..957adb992 100644 --- a/tests/core/proc/mobject/session/testclip.cpp +++ b/tests/core/proc/mobject/session/testclip.cpp @@ -41,18 +41,20 @@ namespace test { using lib::time::Time; using lib::time::Duration; - typedef shared_ptr PM; - typedef backend_interface::MediaAccessFacade MAF; - using backend::test::MediaAccessMock; using asset::VIDEO; + using PM = shared_ptr; + using MAF = backend_interface::MediaAccessFacade; + + using MediaAccessMock = lib::DependInject::Local; + asset::Media & createTestMedia () { // install Mock-Interface to Lumiera backend - lib::test::Depend4Test withinThisScope; + MediaAccessMock useMockMedia; return *asset::Media::create("test-2", VIDEO); // query magic filename }