Lumiera
0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
generic-id-function-test.cpp
Go to the documentation of this file.
1
/*
2
GenericIdFunction(Test) - cover instance and type id generation
3
4
Copyright (C)
5
2015, 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/test/test-helper.hpp"
21
#include "
lib/idi/genfunc.hpp
"
22
//#include "lib/format-cout.hpp"
23
24
//#include <utility>
25
//#include <string>
26
//#include <vector>
27
28
//using std::string;
29
//using std::vector;
30
//using std::swap;
31
32
33
namespace
lib
{
34
namespace
idi {
35
namespace
test
{
36
37
// using lumiera::error::LUMIERA_ERROR_LOGIC;
38
39
namespace
{
//Test fixture....
40
41
class
Thing
42
{ };
43
44
template
<
typename
X>
45
struct
Some
46
{
47
X
x
;
48
};
49
50
typedef
Some<Thing>
SomeThing
;
51
52
}
//(End)Test fixture
53
54
55
56
57
58
59
60
61
62
/**************************************************************************/
68
class
GenericIdFunction_test
:
public
Test
69
{
70
71
virtual
void
72
run
(Arg)
73
{
74
simpleUsage
();
75
verify_typeSymbol
();
76
verify_fullTypeID
();
77
verify_prefix
();
78
verify_typeHash
();
79
verify_symbolicInstanceID
();
80
}
81
82
83
void
84
simpleUsage
()
85
{
86
CHECK (
"int"
== typeSymbol<int>());
87
CHECK (
"bool"
== typeSymbol<bool>());
88
89
CHECK (
"Some"
== categoryFolder<SomeThing>());
90
}
91
92
93
void
94
verify_typeSymbol
()
95
{
96
}
97
98
99
void
100
verify_fullTypeID
()
101
{
102
CHECK(
"Some_Thing"
== typeFullID<SomeThing>());
103
}
104
105
106
void
107
verify_prefix
()
108
{
109
}
110
111
112
void
113
verify_typeHash
()
114
{
115
}
116
117
118
void
119
verify_symbolicInstanceID
()
120
{
121
class
Unique { };
122
123
CHECK (
"Unique.001"
== generateSymbolicID<Unique>());
124
CHECK (
"Unique.002"
== generateSymbolicID<Unique>());
125
CHECK (
"Unique.003"
== generateSymbolicID<Unique>());
126
}
127
};
128
129
131
LAUNCHER
(
GenericIdFunction_test
,
"unit common"
);
132
133
134
135
}}}
// namespace lib::idi::test
lib::idi::test::GenericIdFunction_test
Definition
generic-id-function-test.cpp:69
lib::idi::test::GenericIdFunction_test::run
virtual void run(Arg)
Definition
generic-id-function-test.cpp:72
lib::idi::test::GenericIdFunction_test::verify_typeSymbol
void verify_typeSymbol()
Definition
generic-id-function-test.cpp:94
lib::idi::test::GenericIdFunction_test::verify_prefix
void verify_prefix()
Definition
generic-id-function-test.cpp:107
lib::idi::test::GenericIdFunction_test::verify_symbolicInstanceID
void verify_symbolicInstanceID()
Definition
generic-id-function-test.cpp:119
lib::idi::test::GenericIdFunction_test::verify_typeHash
void verify_typeHash()
Definition
generic-id-function-test.cpp:113
lib::idi::test::GenericIdFunction_test::simpleUsage
void simpleUsage()
Definition
generic-id-function-test.cpp:84
lib::idi::test::GenericIdFunction_test::verify_fullTypeID
void verify_fullTypeID()
Definition
generic-id-function-test.cpp:100
genfunc.hpp
Generic functions to build identification schemes.
lib::idi::test::anonymous_namespace{generic-id-function-test.cpp}::Some::x
X x
Definition
generic-id-function-test.cpp:47
lib::idi::test::anonymous_namespace{generic-id-function-test.cpp}::SomeThing
Some< Thing > SomeThing
Definition
generic-id-function-test.cpp:50
lib::idi::test::anonymous_namespace{generic-id-function-test.cpp}::Thing
Definition
generic-id-function-test.cpp:42
lib::idi::test::anonymous_namespace{generic-id-function-test.cpp}::Some
Definition
generic-id-function-test.cpp:46
lib
Implementation namespace for support and library code.
Definition
common-services.cpp:55
test
Test runner and basic definitions for tests.
run.hpp
Simplistic test class runner.
LAUNCHER
#define LAUNCHER(_TEST_CLASS_, _GROUPS_)
Definition
run.hpp:116
library
idi
generic-id-function-test.cpp
Generated on Thu Dec 11 2025 for Lumiera by
1.9.8