Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
stream-type-basics-test.cpp
Go to the documentation of this file.
1/*
2 StreamTypeBasics(Test) - check the fundamentals of stream type information
3
4 Copyright (C)
5 2008, 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/util.hpp"
21
23#include "teststreamtypes.hpp"
24
25using ::test::Test;
26using util::isnil;
27
28
29namespace steam {
30namespace test_format {
31
33 typedef StreamType const& SType;
35
36
37 /***************************************************************/
43 class StreamTypeBasics_test : public Test
44 {
45 virtual void
46 run (Arg)
47 {
48 ImplType iType = buildImplType ();
50
51 SType type = extend2fullType (iType);
52 basicStreamTypeProperties (type, iType);
53 }
54
57 {
58 STypeManager& typeManager = STypeManager::instance();
59
60 gavl_video_format_t rawType = test_createRawType();
61 ImplType iTy (typeManager.getImpl (GAVL, rawType));
62
63 UNIMPLEMENTED ("at least preliminary implementation of the MediaImplLib interface for lib GAVL");
64
65 TODO ("how to do a simple consistency check on the returned ImplFacade? can we re-create the GAVL frame type?");
66 CHECK (GAVL==iTy.libraryID);
67 return iTy;
68 }
69
70 void
72 {
74 CHECK (iTy2==refType);
75 CHECK (refType==iTy2);
76 TODO ("add equality comparable concept to the ImplType class");
77
78 CHECK (StreamType::VIDEO==refType.getKind());
79 UNIMPLEMENTED ("get a lib descriptor");
80 UNIMPLEMENTED ("check the lib of the type");
81 UNIMPLEMENTED ("compare two types");
82 }
83
84 SType
86 {
87 return STypeManager::instance().getType(iTy);
88 }
89
90 void
92 {
93 CHECK (type.implType);
94 CHECK (iTy==(*type.implType));
95 CHECK (&iTy==type.implType); // actually using the same object (in the registry)
96
97 CHECK (!isnil (type.prototype.id));
98 CHECK (StreamType::VIDEO==type.prototype.kind);
99 CHECK (StreamType::VIDEO==type.implType->getKind());
100
101 CHECK (type.implType->canConvert(iTy)); // of course... they are actually the same
102 CHECK (iTy.canConvert(type)); // because it's based on the same impl type
103
104 CHECK (StreamType::RAW==type.intentionTag);
105 }
106 };
107
109
110
111}} // namespace steam::test_format
112
A (more or less) concrete implementation type, wired up as a facade providing the basic set of operat...
static lib::Depend< STypeManager > instance
access the system-wide stream type manager instance.
ImplFacade const & getImpl(Symbol libID, StreamType::Prototype const &protoType)
build or retrieve an implementation (facade) utilizing a specific MediaImplLib and implementing the g...
void basicStreamTypeProperties(SType type, ImplType iTy)
StreamType::ImplFacade const & ImplType
gavl_video_format_t test_createRawType()
Helper: create an raw GAVL type descriptor usable for generating a Lumiera StreamType.
StreamType::ImplFacade const & test_createImplType()
Helper: create an implementation frame and build the corresponding streamtype.
Steam-Layer implementation namespace root.
bool isnil(lib::time::Duration const &dur)
Simplistic test class runner.
#define LAUNCHER(_TEST_CLASS_, _GROUPS_)
Definition run.hpp:116
Interface to the stream type system.
Unit test helper to create fake streamtype information.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...