Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
mobject-interface-test.cpp
Go to the documentation of this file.
1/*
2 MObjectInterface(Test) - covers behaviour common to all MObjects
3
4 Copyright (C)
5 2010, Hermann Vosseler <Ichthyostega@web.de>
6
7  **Lumiera** is free software; you can redistribute it and/or modify it
8  under the terms of the GNU General Public License as published by the
9  Free Software Foundation; either version 2 of the License, or (at your
10  option) any later version. See the file COPYING for further details.
11
12* *****************************************************************/
13
19#include "lib/test/run.hpp"
20#include "lib/symbol.hpp"
21
22#include "steam/asset/media.hpp"
25//#include "steam/mobject/mobject-ref.hpp"
27//#include "steam/mobject/placement-ref.hpp"
28//#include "steam/mobject/session/placement-index.hpp"
29//#include "steam/mobject/session/session-service-mock-index.hpp"
30//#include "steam/mobject/session/clip.hpp"
31//#include "steam/mobject/explicitplacement.hpp"
34#include "lib/depend-inject.hpp"
36#include "lib/format-cout.hpp"
37
38
39
40
41
42namespace steam {
43namespace mobject {
44namespace test {
45
46// using lib::test::showSizeof;
47
48 using lib::Symbol;
50 using lib::time::FSecs;
51 using lib::time::Time;
52
53
54// using session::Clip;
55// using session::PMedia;
56
58 ::Local<vault::test::MediaAccessMock>;
59
60
61 using namespace mobject::test;
63
64
65 /*****************************************************************************/
73 class MObjectInterface_test : public Test
74 {
75
76
77
78 virtual void
79 run (Arg)
80 {
81 MediaAccessMock useMockMedia;
82
83
84 PMO testClip1 = asset::Media::create("test-1", asset::VIDEO)->createClip();
85 PMO testClip2 = asset::Media::create("test-2", asset::VIDEO)->createClip();
86
87 // set up a tie to fixed start positions (i.e. "properties of placement")
88 testClip1.chain(Time(FSecs(10)));
89 testClip2.chain(Time(FSecs(20)));
90
91 Symbol labelType ("dummyLabel");
92 PMO testLabel1 = MObject::create (labelType);
93
94 testLabel1.chain(Time(FSecs(30)));
95
96 PDummy testDummy1(*new DummyMO);
97 PDummy testDummy2(*new TestSubMO1);
98
99 CHECK (testClip1->isValid());
100 CHECK (testClip2->isValid());
101 CHECK (testLabel1->isValid());
102 CHECK (testDummy1->isValid());
103 CHECK (testDummy2->isValid());
104
105 Duration lenC1 = testClip1->getLength();
106 Duration lenC2 = testClip2->getLength();
107 Duration lenL1 = testLabel1->getLength();
108 CHECK (lenC1 > Time::ZERO);
109 CHECK (lenC2 > Time::ZERO);
110 CHECK (lenL1 ==Time::ZERO);
111
112 cout << testClip1->shortID() << endl;
113 cout << testClip2->shortID() << endl;
114 cout << testLabel1->shortID() << endl;
115 cout << testDummy1->shortID() << endl;
116 cout << testDummy2->shortID() << endl;
117 }
118 };
119
120
121
124
125
126}}} // namespace steam::mobject::test
This framework allows to (re)configure the lib::Depend front-end for dependency-injection.
Token or Atom with distinct identity.
Definition symbol.hpp:120
Duration is the internal Lumiera time metric.
Lumiera's internal time value datatype.
static const Time ZERO
static MediaFactory create
storage for the static MediaFactory instance
Definition media.hpp:75
string const & shortID() const
a short readable ID as a single name-token, denoting both the kind of MObject and some sort of instan...
Definition mobject.cpp:49
virtual bool isValid() const =0
MObject self-test (usable for asserting)
virtual Duration & getLength()=0
static session::MObjectFactory create
Storage for the (single, static) MObject factory object.
Definition mobject.hpp:87
Test MObject subclass, which, contrary to any real MObject, can be created directly without involving...
Per type specific configuration of instances created as service dependencies.
Automatically use custom string conversion in C++ stream output.
Unit test helper to access an emulated media file.
Media data represented a specific kind of Asset.
Core abstraction of the Session model: a media object.
Core factory to generate media objects for use in the Session model.
boost::rational< int64_t > FSecs
rational representation of fractional seconds
TestPlacement< DummyMO > PDummy
lib::DependInject< vault::MediaAccessFacade > ::Local< vault::test::MediaAccessMock > MediaAccessMock
Steam-Layer implementation namespace root.
Test runner and basic definitions for tests.
Core abstraction: placement of a media object into session context.
Simplistic test class runner.
#define LAUNCHER(_TEST_CLASS_, _GROUPS_)
Definition run.hpp:116
Subclass-1 is not defined "processible", thus will always be handled as DummyMO...
Marker types to indicate a literal string and a Symbol.
A hierarchy of simple dummy-Media-Objects for easy unit testing.
a family of time value like entities and their relationships.