Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
ordering-of-assets-test.cpp
Go to the documentation of this file.
1/*
2 OrderingOfAssets(Test) - equality and comparisons
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 "steam/asset/media.hpp"
24#include "steam/asset/proc.hpp"
25
28#include "lib/depend-inject.hpp"
29
30using util::isnil;
31using std::string;
32
33
34namespace steam {
35namespace asset{
36namespace test {
37
39 ::Local<vault::test::MediaAccessMock>;
40
41
42
43
44 /**************************************************/
57 class OrderingOfAssets_test : public Test
58 {
59 virtual void run(Arg)
60 {
61 MediaAccessMock useMockMedia;
62
63
64 Asset::Ident key1("test-1", Category(AUDIO), "ichthyo", 5);
65 PAsset mm1 = asset::Media::create(key1, "Name-1");
66
67 Asset::Ident key2("test-1", Category(AUDIO), "ichthyo", 7);
68 PAsset mm2 = asset::Media::create(key2, "Name-2");
69
70 Asset::Ident key3("test-2", Category(AUDIO), "ichthyo", 5);
71 PAsset mm3 = asset::Media::create(key3, "Name-3");
72
73 Asset::Ident key4("test-2", Category(AUDIO), "stega", 5);
74 PAsset mm4 = asset::Media::create(key4, "Name-4");
75
76 Asset::Ident key5("test-1", Category(VIDEO), "ichthyo", 5);
77 PAsset mm5 = asset::Media::create(key5, "Name-5");
78
79
80 // ordering of keys
81 CHECK (key1 == key2);
82 CHECK (key2 != key3);
83 CHECK (key3 != key4);
84 CHECK (key4 != key5);
85 CHECK (key1 != key5);
86
87 CHECK ( 0 > key2 <=> key3 );
88 CHECK ( 0 < key3 <=> key2 );
89
90 CHECK ( 0 > key3 <=> key4 );
91 CHECK ( 0 > key4 <=> key5 );
92 CHECK ( 0 > key1 <=> key5 );
93 CHECK ( 0 > key2 <=> key5 );
94 CHECK ( 0 > key3 <=> key5 );
95 CHECK ( 0 > key1 <=> key3 );
96 CHECK ( 0 > key1 <=> key4 );
97 CHECK ( 0 > key2 <=> key4 );
98
99
100 // ordering of Asset smart ptrs
101 CHECK (mm1 == mm2);
102 CHECK (mm2 != mm3);
103 CHECK (mm3 != mm4);
104 CHECK (mm4 != mm5);
105 CHECK (mm1 != mm5);
106
107 CHECK (mm2 < mm3);
108 CHECK (mm2 <= mm3);
109 CHECK (mm3 > mm2);
110 CHECK (mm3 >= mm2);
111
112 CHECK (mm3 < mm4);
113 CHECK (mm4 < mm5);
114 CHECK (mm1 < mm5);
115 CHECK (mm2 < mm5);
116 CHECK (mm3 < mm5);
117 CHECK (mm1 < mm3);
118 CHECK (mm1 < mm4);
119 CHECK (mm2 < mm4);
120
121 }
122 };
123
124
127
128
129
130}}} // namespace steam::asset::test
Small helper and diagnostic functions related to Asset and AssetManager.
Steam-Layer Interface: Asset Lookup and Organisation.
This framework allows to (re)configure the lib::Depend front-end for dependency-injection.
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
Definition p.hpp:77
Tree like classification of Assets.
Definition category.hpp:68
static MediaFactory create
storage for the static MediaFactory instance
Definition media.hpp:75
Per type specific configuration of instances created as service dependencies.
Unit test helper to access an emulated media file.
Media data represented a specific kind of Asset.
lib::DependInject< vault::MediaAccessFacade > ::Local< vault::test::MediaAccessMock > MediaAccessMock
The asset subsystem of the Steam-Layer.
Steam-Layer implementation namespace root.
Test runner and basic definitions for tests.
bool isnil(lib::time::Duration const &dur)
Data processing Plugins and Codecs can be treated as a specific Kind of Asset.
Simplistic test class runner.
#define LAUNCHER(_TEST_CLASS_, _GROUPS_)
Definition run.hpp:116
a POD comprised of all the information sufficiently identifying any given Asset.
Definition asset.hpp:147
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...