Lumiera  0.pre.03
»edit your freedom«
make-clip-test.cpp
Go to the documentation of this file.
1 /*
2  MakeClip(Test) - create a Clip from a Media Asset
3 
4  Copyright (C) Lumiera.org
5  2008, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 * *****************************************************/
22 
28 #include "include/logging.h"
29 #include "lib/test/run.hpp"
30 #include "lib/util.hpp"
31 
32 #include "lib/time/timevalue.hpp"
33 #include "steam/assetmanager.hpp"
34 #include "steam/asset/media.hpp"
38 #include "lib/depend-inject.hpp"
39 
40 using util::contains;
41 using util::isnil;
42 using std::string;
43 
44 using std::static_pointer_cast; //TODO only temporarily;
45 
46 namespace steam {
47 namespace asset{
48 namespace test {
49 
50  using MediaAccessMock = lib::DependInject<vault::MediaAccessFacade>
51  ::Local<vault::test::MediaAccessMock>;
52 
53 
54 
55 
56  /*******************************************************************/
61  class MakeClip_test : public Test
62  {
63  typedef lib::P<asset::Media> PM;
64  typedef asset::Media::PClip PC;
65 
66  virtual void run (Arg)
67  {
68  MediaAccessMock useMockMedia;
69 
70 
71  PM mm = asset::Media::create("test-1", VIDEO);
72  PC cc = mm->createClip();
73  PM cm = cc->getMedia();
74 
75  CHECK (cm);
76  CHECK (!isnil (cc->getLength()));
77  CHECK (cm->ident.category.hasKind (VIDEO));
78  CHECK (cm->getFilename() == mm->getFilename());
79 TODO ("implement Processing Pattern!!!");
80 // CHECK (cm->howtoProc() == mm->howtoProc());
81  CHECK (cm->ident.org == mm->ident.org);
82  CHECK (dependencyCheck (cm,mm));
83 
84  TRACE (asset_mem, "leaving MakeClip_test::run()");
85  TRACE (mobject_mem, "leaving MakeClip_test::run()");
86  }
87 
88 
89  };
90 
91 
93  LAUNCHER (MakeClip_test, "function asset");
94 
95 
96 
97 }}} // namespace steam::asset::test
A refcounting Handle to an MObject of type MO, used to constrain or explicitly specify the location w...
Definition: trait.hpp:91
Steam-Layer Interface: Asset Lookup and Organisation.
Media data represented a specific kind of Asset.
Definition: run.hpp:49
Per type specific configuration of instances created as service dependencies.
MObject in the Session to represent a clip on the timeline.
Unit test helper to access an emulated media file.
This header is for including and configuring NoBug.
static MediaFactory create
storage for the static MediaFactory instance
Definition: media.hpp:84
Steam-Layer implementation namespace root.
This framework allows to (re)configure the lib::Depend front-end for dependency-injection.
Simple test class runner.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
Small helper and diagnostic functions related to Asset and AssetManager.
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
Definition: trait.hpp:80
a family of time value like entities and their relationships.
The asset subsystem of the Steam-Layer.
Definition: wrapperptr.hpp:44
bool contains(SEQ const &cont, typename SEQ::const_reference val)
shortcut for brute-force containment test in any sequential container
Definition: util.hpp:255