36 using lumiera::error::LUMIERA_ERROR_LOGIC;
40 using DataSeq = vector<string>;
43 #define TOK(id) id(STRINGIFY(id)) 45 string TOK(a1), TOK(a2), TOK(a3), TOK(a4), TOK(a5);
46 string TOK(b1), TOK(b2), TOK(b3), TOK(b4);
85 DataSeq data({a5,a2,a1,a4,a3});
88 CHECK (5 == idx.size());
90 CHECK (idx.contains(a1));
91 CHECK (idx.contains(a2));
92 CHECK (idx.contains(a3));
93 CHECK (idx.contains(a4));
94 CHECK (idx.contains(a5));
96 CHECK (!idx.contains(b1));
97 CHECK (!idx.contains(b2));
100 CHECK (a5 == idx.getElement(0));
101 CHECK (a2 == idx.getElement(1));
102 CHECK (a1 == idx.getElement(2));
103 CHECK (a4 == idx.getElement(3));
104 CHECK (a3 == idx.getElement(4));
107 CHECK (0 == idx.pos(a5));
108 CHECK (1 == idx.pos(a2));
109 CHECK (2 == idx.pos(a1));
110 CHECK (3 == idx.pos(a4));
111 CHECK (4 == idx.pos(a3));
118 DataSeq data({a5,a2,a1,a4,a3});
124 CHECK (5 == idx.size());
126 CHECK (idx.contains(a1));
127 CHECK (idx.contains(a2));
128 CHECK (idx.contains(a3));
129 CHECK (idx.contains(a4));
130 CHECK (idx.contains(a5));
132 CHECK (!idx.contains(b1));
133 CHECK (!idx.contains(b2));
135 CHECK (0 == idx.pos(a5));
136 CHECK (1 == idx.pos(a2));
137 CHECK (2 == idx.pos(a1));
138 CHECK (3 == idx.pos(a4));
139 CHECK (4 == idx.pos(a3));
146 DataSeq data({a5,a2,a1,a4,a3});
149 for (
auto elm : Index(data))
151 CHECK (elm == data[i++]);
159 DataSeq data({a5,a2,a1,a4,a2,a3});
168 DataSeq seqA({a5,a4,a1,a2,a3});
169 DataSeq seqB({b4,b3,b2,b1});
173 CHECK (5 == idxA.size());
174 CHECK (4 == idxB.size());
176 CHECK ( idxA.contains(a1));
177 CHECK (!idxA.contains(b1));
178 CHECK (!idxB.contains(a1));
179 CHECK ( idxB.contains(b1));
183 CHECK (!idxA.contains(a1));
184 CHECK ( idxA.contains(b1));
185 CHECK ( idxB.contains(a1));
186 CHECK (!idxB.contains(b1));
189 CHECK (4 == idxA.size());
190 CHECK (4 == idxB.size());
192 CHECK (!idxA.contains(a1));
193 CHECK ( idxA.contains(b1));
194 CHECK (!idxB.contains(a1));
195 CHECK ( idxB.contains(b1));
#define VERIFY_ERROR(ERROR_ID, ERRONEOUS_STATEMENT)
Macro to verify that a statement indeed raises an exception.
Implementation namespace for support and library code.
Simplistic test class runner.
data snapshot and lookup table
Generic lookup table for a sequence of unique values.
A collection of frequently used helper functions to support unit testing.