Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
testasset.hpp
Go to the documentation of this file.
1/*
2 TESTASSET.hpp - test asset (stub) for checking internal asset functionality
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#ifndef ASSET_TESTASSET_H
20#define ASSET_TESTASSET_H
21
22
23#include "steam/asset.hpp"
24#include "lib/format-string.hpp"
25
26
27
28namespace steam {
29namespace asset{
30namespace test {
31
32 using util::_Fmt;
33
34
42 template<class A>
43 class TestAsset : public A
44 {
45 TestAsset () ;
46 TestAsset (PAsset&);
47
48 static void deleter (TestAsset<A>* aa) { delete aa; }
49
50 public:
52
53 static PA create () { return (new TestAsset<A> )->ptrFromThis(); }
54 static PA create (PAsset& pRef) { return (new TestAsset<A> (pRef))->ptrFromThis(); }
55
56 /* === interesting asset features we want to access for tests === */
57 void call_unlink () { this->unlink (); }
58 void call_unlink (IDA target) { this->unlink (target); }
59 void set_depend (PAsset parent) { this->defineDependency (parent); }
60
61 private:
62 PA ptrFromThis ();
63 };
64
65
66
67}}} // namespace steam::asset::test
68#endif
Steam-Layer Interface: Assets.
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
Definition p.hpp:77
Test(mock) asset subclass usable for hijacking a given asset class (template parameter) and subsequen...
Definition testasset.hpp:44
void call_unlink(IDA target)
Definition testasset.hpp:58
static void deleter(TestAsset< A > *aa)
Definition testasset.hpp:48
static PA create(PAsset &pRef)
Definition testasset.hpp:54
lib::P< TestAsset< A > > PA
Definition testasset.hpp:51
void set_depend(PAsset parent)
Definition testasset.hpp:59
A front-end for using printf-style formatting.
Front-end for printf-style string template interpolation.
The asset subsystem of the Steam-Layer.
Steam-Layer implementation namespace root.
Test runner and basic definitions for tests.