Lumiera  0.pre.03
»edit your freedom«
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
Definition: run.hpp:40
Implementation namespace for support and library code.
Generic functions to build identification schemes.
Simplistic test class runner.