1//
2// NamedTuplesTest.cpp
3//
4// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
5// and Contributors.
6//
7// SPDX-License-Identifier: BSL-1.0
8//
9
10
11#include "NamedTuplesTest.h"
12#include "Poco/CppUnit/TestCaller.h"
13#include "Poco/CppUnit/TestSuite.h"
14#include "Poco/NamedTuple.h"
15#include "Poco/Exception.h"
16
17
18using Poco::NamedTuple;
19using Poco::Int8;
20using Poco::UInt8;
21using Poco::Int16;
22using Poco::UInt16;
23using Poco::Int32;
24using Poco::UInt32;
25using Poco::Int8;
26using Poco::UInt8;
27using Poco::Int16;
28using Poco::UInt16;
29using Poco::Int32;
30using Poco::UInt32;
31using Poco::NotFoundException;
32using Poco::InvalidArgumentException;
33
34
35NamedTuplesTest::NamedTuplesTest(const std::string& rName): CppUnit::TestCase(rName)
36{
37}
38
39
40NamedTuplesTest::~NamedTuplesTest()
41{
42}
43
44
45void NamedTuplesTest::testNamedTuple1()
46{
47 typedef NamedTuple<std::string> TupleType;
48
49 TupleType aTuple;
50
51 assertTrue (aTuple["A"] == "");
52
53 try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
54 catch (NotFoundException&) { }
55 assertTrue (aTuple.length == 1);
56
57 TupleType aTuple2("string1", "1");
58 assertTrue (aTuple2["string1"] == "1");
59
60 assertTrue (aTuple != aTuple2);
61 aTuple = aTuple2;
62 assertTrue (aTuple == aTuple2);
63 aTuple2.set<0>("2");
64 assertTrue (aTuple < aTuple2);
65
66 TupleType aTuple3(aTuple2.names());
67 assertTrue (aTuple3.names() == aTuple2.names());
68 assertTrue (aTuple3["string1"] == "");
69 assertTrue (aTuple3.length == 1);
70
71 assertTrue (aTuple.getName(0) == "string1");
72 aTuple.setName(0, "New Name");
73 assertTrue (aTuple.getName(0) == "New Name");
74
75 try { aTuple.setName(20, ""); fail("must fail"); }
76 catch (InvalidArgumentException&) { }
77}
78
79
80void NamedTuplesTest::testNamedTuple2()
81{
82 typedef NamedTuple<std::string, int> TupleType;
83
84 TupleType aTuple;
85
86 assertTrue (aTuple["A"] == "");
87 assertTrue (aTuple["B"] == 0);
88
89 try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
90 catch (NotFoundException&) { }
91 assertTrue (aTuple.length == 2);
92
93 TupleType aTuple2("string1", "1",
94 "int1", 1);
95 assertTrue (aTuple2["string1"] == "1");
96 assertTrue (aTuple2["int1"] == 1);
97
98 assertTrue (aTuple != aTuple2);
99 aTuple = aTuple2;
100 assertTrue (aTuple == aTuple2);
101 aTuple2.get<1>()++;
102 assertTrue (aTuple < aTuple2);
103
104 TupleType aTuple3(aTuple2.names());
105 assertTrue (aTuple3.names() == aTuple2.names());
106 assertTrue (aTuple3["string1"] == "");
107 assertTrue (aTuple3["int1"] == 0);
108 assertTrue (aTuple3.length == 2);
109
110 assertTrue (aTuple.getName(0) == "string1");
111 aTuple.setName(0, "New Name");
112 assertTrue (aTuple.getName(0) == "New Name");
113
114 try { aTuple.setName(20, ""); fail("must fail"); }
115 catch (InvalidArgumentException&) { }
116}
117
118
119void NamedTuplesTest::testNamedTuple3()
120{
121 typedef NamedTuple<std::string,
122 int,
123 bool> TupleType;
124
125 TupleType aTuple;
126
127 assertTrue (aTuple["A"] == "");
128 assertTrue (aTuple["B"] == 0);
129 assertTrue (aTuple["C"] == false);
130
131 try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
132 catch (NotFoundException&) { }
133 assertTrue (aTuple.length == 3);
134
135 TupleType aTuple2("string1", "1",
136 "int1", 1,
137 "bool1", true);
138 assertTrue (aTuple2["string1"] == "1");
139 assertTrue (aTuple2["int1"] == 1);
140 assertTrue (aTuple2["bool1"] == true);
141
142 assertTrue (aTuple != aTuple2);
143 aTuple = aTuple2;
144 assertTrue (aTuple == aTuple2);
145 aTuple2.get<1>()++;
146 assertTrue (aTuple < aTuple2);
147
148 TupleType aTuple3(aTuple2.names());
149 assertTrue (aTuple3.names() == aTuple2.names());
150 assertTrue (aTuple3["string1"] == "");
151 assertTrue (aTuple3["int1"] == 0);
152 assertTrue (aTuple3["bool1"] == false);
153 assertTrue (aTuple3.length == 3);
154
155 assertTrue (aTuple.getName(0) == "string1");
156 aTuple.setName(0, "New Name");
157 assertTrue (aTuple.getName(0) == "New Name");
158
159 try { aTuple.setName(20, ""); fail("must fail"); }
160 catch (InvalidArgumentException&) { }
161}
162
163
164void NamedTuplesTest::testNamedTuple4()
165{
166 typedef NamedTuple<std::string,
167 int,
168 bool,
169 float> TupleType;
170
171 TupleType aTuple;
172
173 assertTrue (aTuple["A"] == "");
174 assertTrue (aTuple["B"] == 0);
175 assertTrue (aTuple["C"] == false);
176
177 try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
178 catch (NotFoundException&) { }
179 assertTrue (aTuple.length == 4);
180
181 TupleType aTuple2("string1", "1",
182 "int1", 1,
183 "bool1", true,
184 "float1", 1.5f);
185 assertTrue (aTuple2["string1"] == "1");
186 assertTrue (aTuple2["int1"] == 1);
187 assertTrue (aTuple2["bool1"] == true);
188 assertTrue (aTuple2["float1"] == 1.5);
189
190 assertTrue (aTuple != aTuple2);
191 aTuple = aTuple2;
192 assertTrue (aTuple == aTuple2);
193 aTuple2.get<1>()++;
194 assertTrue (aTuple < aTuple2);
195
196 TupleType aTuple3(aTuple2.names());
197 assertTrue (aTuple3.names() == aTuple2.names());
198 assertTrue (aTuple3["string1"] == "");
199 assertTrue (aTuple3["int1"] == 0);
200 assertTrue (aTuple3["bool1"] == false);
201 assertTrue (aTuple3.length == 4);
202
203 assertTrue (aTuple.getName(0) == "string1");
204 aTuple.setName(0, "New Name");
205 assertTrue (aTuple.getName(0) == "New Name");
206
207 try { aTuple.setName(20, ""); fail("must fail"); }
208 catch (InvalidArgumentException&) { }
209}
210
211
212void NamedTuplesTest::testNamedTuple5()
213{
214 typedef NamedTuple<std::string,
215 int,
216 bool,
217 float,
218 char> TupleType;
219
220 TupleType aTuple;
221
222 assertTrue (aTuple["A"] == "");
223 assertTrue (aTuple["B"] == 0);
224 assertTrue (aTuple["C"] == false);
225 assertTrue (aTuple["E"] == 0);
226
227 try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
228 catch (NotFoundException&) { }
229 assertTrue (aTuple.length == 5);
230
231 TupleType aTuple2("string1", "1",
232 "int1", 1,
233 "bool1", true,
234 "float1", 1.5f,
235 "char1", 'c');
236 assertTrue (aTuple2["string1"] == "1");
237 assertTrue (aTuple2["int1"] == 1);
238 assertTrue (aTuple2["bool1"] == true);
239 assertTrue (aTuple2["float1"] == 1.5);
240 assertTrue (aTuple2["char1"] == 'c');
241
242 assertTrue (aTuple != aTuple2);
243 aTuple = aTuple2;
244 assertTrue (aTuple == aTuple2);
245 aTuple2.get<1>()++;
246 assertTrue (aTuple < aTuple2);
247
248 TupleType aTuple3(aTuple2.names());
249 assertTrue (aTuple3.names() == aTuple2.names());
250 assertTrue (aTuple3["string1"] == "");
251 assertTrue (aTuple3["int1"] == 0);
252 assertTrue (aTuple3["bool1"] == false);
253 assertTrue (aTuple3["char1"] == 0);
254 assertTrue (aTuple3.length == 5);
255
256 assertTrue (aTuple.getName(0) == "string1");
257 aTuple.setName(0, "New Name");
258 assertTrue (aTuple.getName(0) == "New Name");
259
260 try { aTuple.setName(20, ""); fail("must fail"); }
261 catch (InvalidArgumentException&) { }
262}
263
264
265void NamedTuplesTest::testNamedTuple6()
266{
267 typedef NamedTuple<std::string,
268 int,
269 bool,
270 float,
271 char,
272 long> TupleType;
273
274 TupleType aTuple;
275
276 assertTrue (aTuple["A"] == "");
277 assertTrue (aTuple["B"] == 0);
278 assertTrue (aTuple["C"] == false);
279 assertTrue (aTuple["E"] == 0);
280 assertTrue (aTuple["F"] == 0);
281
282 try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
283 catch (NotFoundException&) { }
284 assertTrue (aTuple.length == 6);
285
286 TupleType aTuple2("string1", "1",
287 "int1", 1,
288 "bool1", true,
289 "float1", 1.5f,
290 "char1", 'c',
291 "long1", 999);
292 assertTrue (aTuple2["string1"] == "1");
293 assertTrue (aTuple2["int1"] == 1);
294 assertTrue (aTuple2["bool1"] == true);
295 assertTrue (aTuple2["float1"] == 1.5);
296 assertTrue (aTuple2["char1"] == 'c');
297 //assertTrue (aTuple2["long1"] == 999);
298
299 assertTrue (aTuple != aTuple2);
300 aTuple = aTuple2;
301 assertTrue (aTuple == aTuple2);
302 aTuple2.get<1>()++;
303 assertTrue (aTuple < aTuple2);
304
305 TupleType aTuple3(aTuple2.names());
306 assertTrue (aTuple3.names() == aTuple2.names());
307 assertTrue (aTuple3["string1"] == "");
308 assertTrue (aTuple3["int1"] == 0);
309 assertTrue (aTuple3["bool1"] == false);
310 assertTrue (aTuple3["char1"] == 0);
311 //assertTrue (aTuple3["long1"] == 0);
312 assertTrue (aTuple3.length == 6);
313
314 assertTrue (aTuple.getName(0) == "string1");
315 aTuple.setName(0, "New Name");
316 assertTrue (aTuple.getName(0) == "New Name");
317
318 try { aTuple.setName(20, ""); fail("must fail"); }
319 catch (InvalidArgumentException&) { }
320}
321
322
323void NamedTuplesTest::testNamedTuple7()
324{
325 typedef NamedTuple<std::string,
326 int,
327 bool,
328 float,
329 char,
330 long,
331 double> TupleType;
332
333 TupleType aTuple;
334
335 assertTrue (aTuple["A"] == "");
336 assertTrue (aTuple["B"] == 0);
337 assertTrue (aTuple["C"] == false);
338 assertTrue (aTuple["E"] == 0);
339 assertTrue (aTuple["F"] == 0);
340
341 try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
342 catch (NotFoundException&) { }
343 assertTrue (aTuple.length == 7);
344
345 TupleType aTuple2("string1", "1",
346 "int1", 1,
347 "bool1", true,
348 "float1", 1.5f,
349 "char1", 'c',
350 "long1", 999,
351 "double1", 1.5);
352 assertTrue (aTuple2["string1"] == "1");
353 assertTrue (aTuple2["int1"] == 1);
354 assertTrue (aTuple2["bool1"] == true);
355 assertTrue (aTuple2["float1"] == 1.5);
356 assertTrue (aTuple2["char1"] == 'c');
357 assertTrue (aTuple2["long1"] == 999);
358 assertTrue (aTuple2["double1"] == 1.5);
359
360 assertTrue (aTuple != aTuple2);
361 aTuple = aTuple2;
362 assertTrue (aTuple == aTuple2);
363 aTuple2.get<1>()++;
364 assertTrue (aTuple < aTuple2);
365
366 TupleType aTuple3(aTuple2.names());
367 assertTrue (aTuple3.names() == aTuple2.names());
368 assertTrue (aTuple3["string1"] == "");
369 assertTrue (aTuple3["int1"] == 0);
370 assertTrue (aTuple3["bool1"] == false);
371 assertTrue (aTuple3["char1"] == 0);
372 assertTrue (aTuple3["long1"] == 0);
373 assertTrue (aTuple3.length == 7);
374
375 assertTrue (aTuple.getName(0) == "string1");
376 aTuple.setName(0, "New Name");
377 assertTrue (aTuple.getName(0) == "New Name");
378
379 try { aTuple.setName(20, ""); fail("must fail"); }
380 catch (InvalidArgumentException&) { }
381}
382
383
384void NamedTuplesTest::testNamedTuple8()
385{
386 typedef NamedTuple<std::string,
387 int,
388 bool,
389 float,
390 char,
391 long,
392 double,
393 short> TupleType;
394
395 TupleType aTuple;
396
397 assertTrue (aTuple["A"] == "");
398 assertTrue (aTuple["B"] == 0);
399 assertTrue (aTuple["C"] == false);
400 assertTrue (aTuple["E"] == 0);
401 assertTrue (aTuple["F"] == 0);
402 assertTrue (aTuple["H"] == 0);
403
404 try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
405 catch (NotFoundException&) { }
406 assertTrue (aTuple.length == 8);
407
408 TupleType aTuple2("string1", "1",
409 "int1", 1,
410 "bool1", true,
411 "float1", 1.5f,
412 "char1", 'c',
413 "long1", 999,
414 "double1", 1.5,
415 "short1", 32700);
416 assertTrue (aTuple2["string1"] == "1");
417 assertTrue (aTuple2["int1"] == 1);
418 assertTrue (aTuple2["bool1"] == true);
419 assertTrue (aTuple2["float1"] == 1.5);
420 assertTrue (aTuple2["char1"] == 'c');
421 assertTrue (aTuple2["long1"] == 999);
422 assertTrue (aTuple2["double1"] == 1.5);
423 assertTrue (aTuple2["short1"] == 32700);
424
425 assertTrue (aTuple != aTuple2);
426 aTuple = aTuple2;
427 assertTrue (aTuple == aTuple2);
428 aTuple2.get<1>()++;
429 assertTrue (aTuple < aTuple2);
430
431 TupleType aTuple3(aTuple2.names());
432 assertTrue (aTuple3.names() == aTuple2.names());
433 assertTrue (aTuple3["string1"] == "");
434 assertTrue (aTuple3["int1"] == 0);
435 assertTrue (aTuple3["bool1"] == false);
436 assertTrue (aTuple3["char1"] == 0);
437 assertTrue (aTuple3["long1"] == 0);
438 assertTrue (aTuple3["short1"] == 0);
439 assertTrue (aTuple3.length == 8);
440
441 assertTrue (aTuple.getName(0) == "string1");
442 aTuple.setName(0, "New Name");
443 assertTrue (aTuple.getName(0) == "New Name");
444
445 try { aTuple.setName(20, ""); fail("must fail"); }
446 catch (InvalidArgumentException&) { }
447}
448
449
450
451void NamedTuplesTest::testNamedTuple9()
452{
453 typedef NamedTuple<std::string,
454 int,
455 bool,
456 float,
457 char,
458 long,
459 double,
460 short,
461 std::string> TupleType;
462
463 TupleType aTuple;
464
465 assertTrue (aTuple["A"] == "");
466 assertTrue (aTuple["B"] == 0);
467 assertTrue (aTuple["C"] == false);
468 assertTrue (aTuple["E"] == 0);
469 assertTrue (aTuple["F"] == 0);
470 assertTrue (aTuple["H"] == 0);
471 assertTrue (aTuple["I"] == "");
472
473 try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
474 catch (NotFoundException&) { }
475 assertTrue (aTuple.length == 9);
476
477 TupleType aTuple2("string1", "1",
478 "int1", 1,
479 "bool1", true,
480 "float1", 1.5f,
481 "char1", 'c',
482 "long1", 999,
483 "double1", 1.5,
484 "short1", 32700,
485 "string2", "2");
486 assertTrue (aTuple2["string1"] == "1");
487 assertTrue (aTuple2["int1"] == 1);
488 assertTrue (aTuple2["bool1"] == true);
489 assertTrue (aTuple2["float1"] == 1.5);
490 assertTrue (aTuple2["char1"] == 'c');
491 assertTrue (aTuple2["long1"] == 999);
492 assertTrue (aTuple2["double1"] == 1.5);
493 assertTrue (aTuple2["short1"] == 32700);
494 assertTrue (aTuple2["string2"] == "2");
495
496 assertTrue (aTuple != aTuple2);
497 aTuple = aTuple2;
498 assertTrue (aTuple == aTuple2);
499 aTuple2.get<1>()++;
500 assertTrue (aTuple < aTuple2);
501
502 TupleType aTuple3(aTuple2.names());
503 assertTrue (aTuple3.names() == aTuple2.names());
504 assertTrue (aTuple3["string1"] == "");
505 assertTrue (aTuple3["int1"] == 0);
506 assertTrue (aTuple3["bool1"] == false);
507 assertTrue (aTuple3["char1"] == 0);
508 assertTrue (aTuple3["long1"] == 0);
509 assertTrue (aTuple3["short1"] == 0);
510 assertTrue (aTuple3["string2"] == "");
511 assertTrue (aTuple3.length == 9);
512
513 assertTrue (aTuple.getName(0) == "string1");
514 aTuple.setName(0, "New Name");
515 assertTrue (aTuple.getName(0) == "New Name");
516
517 try { aTuple.setName(20, ""); fail("must fail"); }
518 catch (InvalidArgumentException&) { }
519}
520
521
522void NamedTuplesTest::testNamedTuple10()
523{
524 typedef NamedTuple<std::string,
525 int,
526 bool,
527 float,
528 char,
529 long,
530 double,
531 short,
532 std::string,
533 int> TupleType;
534
535 TupleType aTuple;
536
537 assertTrue (aTuple["A"] == "");
538 assertTrue (aTuple["B"] == 0);
539 assertTrue (aTuple["C"] == false);
540 assertTrue (aTuple["E"] == 0);
541 assertTrue (aTuple["F"] == 0);
542 assertTrue (aTuple["H"] == 0);
543 assertTrue (aTuple["I"] == "");
544 assertTrue (aTuple["J"] == 0);
545
546 try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
547 catch (NotFoundException&) { }
548 assertTrue (aTuple.length == 10);
549
550 TupleType aTuple2("string1", "1",
551 "int1", 1,
552 "bool1", true,
553 "float1", 1.5f,
554 "char1", 'c',
555 "long1", 999,
556 "double1", 1.5,
557 "short1", 32700,
558 "string2", "2",
559 "int2", 2 );
560 assertTrue (aTuple2["string1"] == "1");
561 assertTrue (aTuple2["int1"] == 1);
562 assertTrue (aTuple2["bool1"] == true);
563 assertTrue (aTuple2["float1"] == 1.5);
564 assertTrue (aTuple2["char1"] == 'c');
565 assertTrue (aTuple2["long1"] == 999);
566 assertTrue (aTuple2["double1"] == 1.5);
567 assertTrue (aTuple2["short1"] == 32700);
568 assertTrue (aTuple2["string2"] == "2");
569 assertTrue (aTuple2["int2"] == 2);
570
571 assertTrue (aTuple != aTuple2);
572 aTuple = aTuple2;
573 assertTrue (aTuple == aTuple2);
574 aTuple2.get<1>()++;
575 assertTrue (aTuple < aTuple2);
576
577 TupleType aTuple3(aTuple2.names());
578 assertTrue (aTuple3.names() == aTuple2.names());
579 assertTrue (aTuple3["string1"] == "");
580 assertTrue (aTuple3["int1"] == 0);
581 assertTrue (aTuple3["bool1"] == false);
582 assertTrue (aTuple3["char1"] == 0);
583 assertTrue (aTuple3["long1"] == 0);
584 assertTrue (aTuple3["short1"] == 0);
585 assertTrue (aTuple3["string2"] == "");
586 assertTrue (aTuple3["int2"] == 0);
587 assertTrue (aTuple3.length == 10);
588
589 assertTrue (aTuple.getName(0) == "string1");
590 aTuple.setName(0, "New Name");
591 assertTrue (aTuple.getName(0) == "New Name");
592
593 try { aTuple.setName(20, ""); fail("must fail"); }
594 catch (InvalidArgumentException&) { }
595}
596
597
598void NamedTuplesTest::testNamedTuple11()
599{
600 typedef NamedTuple<std::string,
601 int,
602 bool,
603 float,
604 char,
605 long,
606 double,
607 short,
608 std::string,
609 int,
610 std::string> TupleType;
611
612 TupleType aTuple;
613
614 assertTrue (aTuple["A"] == "");
615 assertTrue (aTuple["B"] == 0);
616 assertTrue (aTuple["C"] == false);
617 assertTrue (aTuple["E"] == 0);
618 assertTrue (aTuple["F"] == 0);
619 assertTrue (aTuple["H"] == 0);
620 assertTrue (aTuple["I"] == "");
621 assertTrue (aTuple["J"] == 0);
622 assertTrue (aTuple["K"] == "");
623
624 try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
625 catch (NotFoundException&) { }
626 assertTrue (aTuple.length == 11);
627
628 TupleType aTuple2("string1", "1",
629 "int1", 1,
630 "bool1", true,
631 "float1", 1.5f,
632 "char1", 'c',
633 "long1", 999,
634 "double1", 1.5,
635 "short1", 32700,
636 "string2", "2",
637 "int2", 2,
638 "string3", "3");
639 assertTrue (aTuple2["string1"] == "1");
640 assertTrue (aTuple2["int1"] == 1);
641 assertTrue (aTuple2["bool1"] == true);
642 assertTrue (aTuple2["float1"] == 1.5);
643 assertTrue (aTuple2["char1"] == 'c');
644 assertTrue (aTuple2["long1"] == 999);
645 assertTrue (aTuple2["double1"] == 1.5);
646 assertTrue (aTuple2["short1"] == 32700);
647 assertTrue (aTuple2["string2"] == "2");
648 assertTrue (aTuple2["int2"] == 2);
649 assertTrue (aTuple2["string3"] == "3");
650
651 assertTrue (aTuple != aTuple2);
652 aTuple = aTuple2;
653 assertTrue (aTuple == aTuple2);
654 aTuple2.get<1>()++;
655 assertTrue (aTuple < aTuple2);
656
657 TupleType aTuple3(aTuple2.names());
658 assertTrue (aTuple3.names() == aTuple2.names());
659 assertTrue (aTuple3["string1"] == "");
660 assertTrue (aTuple3["int1"] == 0);
661 assertTrue (aTuple3["bool1"] == false);
662 assertTrue (aTuple3["char1"] == 0);
663 assertTrue (aTuple3["long1"] == 0);
664 assertTrue (aTuple3["short1"] == 0);
665 assertTrue (aTuple3["string2"] == "");
666 assertTrue (aTuple3["int2"] == 0);
667 assertTrue (aTuple3["string3"] == "");
668 assertTrue (aTuple3.length == 11);
669
670 assertTrue (aTuple.getName(0) == "string1");
671 aTuple.setName(0, "New Name");
672 assertTrue (aTuple.getName(0) == "New Name");
673
674 try { aTuple.setName(20, ""); fail("must fail"); }
675 catch (InvalidArgumentException&) { }
676}
677
678
679void NamedTuplesTest::testNamedTuple12()
680{
681 typedef NamedTuple<std::string,
682 int,
683 bool,
684 float,
685 char,
686 long,
687 double,
688 short,
689 std::string,
690 int,
691 std::string,
692 int> TupleType;
693
694 TupleType aTuple;
695
696 assertTrue (aTuple["A"] == "");
697 assertTrue (aTuple["B"] == 0);
698 assertTrue (aTuple["C"] == false);
699 assertTrue (aTuple["E"] == 0);
700 assertTrue (aTuple["F"] == 0);
701 assertTrue (aTuple["H"] == 0);
702 assertTrue (aTuple["I"] == "");
703 assertTrue (aTuple["J"] == 0);
704 assertTrue (aTuple["K"] == "");
705 assertTrue (aTuple["L"] == 0);
706
707 try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
708 catch (NotFoundException&) { }
709 assertTrue (aTuple.length == 12);
710
711 TupleType aTuple2("string1", "1",
712 "int1", 1,
713 "bool1", true,
714 "float1", 1.5f,
715 "char1", 'c',
716 "long1", 999,
717 "double1", 1.5,
718 "short1", 32700,
719 "string2", "2",
720 "int2", 2,
721 "string3", "3",
722 "int3", 3);
723 assertTrue (aTuple2["string1"] == "1");
724 assertTrue (aTuple2["int1"] == 1);
725 assertTrue (aTuple2["bool1"] == true);
726 assertTrue (aTuple2["float1"] == 1.5);
727 assertTrue (aTuple2["char1"] == 'c');
728 assertTrue (aTuple2["long1"] == 999);
729 assertTrue (aTuple2["double1"] == 1.5);
730 assertTrue (aTuple2["short1"] == 32700);
731 assertTrue (aTuple2["string2"] == "2");
732 assertTrue (aTuple2["int2"] == 2);
733 assertTrue (aTuple2["string3"] == "3");
734 assertTrue (aTuple2["int3"] == 3);
735
736 assertTrue (aTuple != aTuple2);
737 aTuple = aTuple2;
738 assertTrue (aTuple == aTuple2);
739 aTuple2.get<1>()++;
740 assertTrue (aTuple < aTuple2);
741
742 TupleType aTuple3(aTuple2.names());
743 assertTrue (aTuple3.names() == aTuple2.names());
744 assertTrue (aTuple3["string1"] == "");
745 assertTrue (aTuple3["int1"] == 0);
746 assertTrue (aTuple3["bool1"] == false);
747 assertTrue (aTuple3["char1"] == 0);
748 assertTrue (aTuple3["long1"] == 0);
749 assertTrue (aTuple3["short1"] == 0);
750 assertTrue (aTuple3["string2"] == "");
751 assertTrue (aTuple3["int2"] == 0);
752 assertTrue (aTuple3["string3"] == "");
753 assertTrue (aTuple3.length == 12);
754
755 assertTrue (aTuple.getName(0) == "string1");
756 aTuple.setName(0, "New Name");
757 assertTrue (aTuple.getName(0) == "New Name");
758
759 try { aTuple.setName(20, ""); fail("must fail"); }
760 catch (InvalidArgumentException&) { }
761}
762
763
764void NamedTuplesTest::testNamedTuple13()
765{
766 typedef NamedTuple<std::string,
767 int,
768 bool,
769 float,
770 char,
771 long,
772 double,
773 short,
774 std::string,
775 int,
776 std::string,
777 int,
778 bool> TupleType;
779
780 TupleType aTuple;
781
782 assertTrue (aTuple["A"] == "");
783 assertTrue (aTuple["B"] == 0);
784 assertTrue (aTuple["C"] == false);
785 assertTrue (aTuple["E"] == 0);
786 assertTrue (aTuple["F"] == 0);
787 assertTrue (aTuple["H"] == 0);
788 assertTrue (aTuple["I"] == "");
789 assertTrue (aTuple["J"] == 0);
790 assertTrue (aTuple["K"] == "");
791 assertTrue (aTuple["L"] == 0);
792 assertTrue (aTuple["M"] == false);
793
794 try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
795 catch (NotFoundException&) { }
796 assertTrue (aTuple.length == 13);
797
798 TupleType aTuple2("string1", "1",
799 "int1", 1,
800 "bool1", true,
801 "float1", 1.5f,
802 "char1", 'c',
803 "long1", 999,
804 "double1", 1.5,
805 "short1", 32700,
806 "string2", "2",
807 "int2", 2,
808 "string3", "3",
809 "int3", 3,
810 "bool2", true);
811 assertTrue (aTuple2["string1"] == "1");
812 assertTrue (aTuple2["int1"] == 1);
813 assertTrue (aTuple2["bool1"] == true);
814 assertTrue (aTuple2["float1"] == 1.5);
815 assertTrue (aTuple2["char1"] == 'c');
816 assertTrue (aTuple2["long1"] == 999);
817 assertTrue (aTuple2["double1"] == 1.5);
818 assertTrue (aTuple2["short1"] == 32700);
819 assertTrue (aTuple2["string2"] == "2");
820 assertTrue (aTuple2["int2"] == 2);
821 assertTrue (aTuple2["string3"] == "3");
822 assertTrue (aTuple2["int3"] == 3);
823 assertTrue (aTuple2["bool2"] == true);
824
825 assertTrue (aTuple != aTuple2);
826 aTuple = aTuple2;
827 assertTrue (aTuple == aTuple2);
828 aTuple2.get<1>()++;
829 assertTrue (aTuple < aTuple2);
830
831 TupleType aTuple3(aTuple2.names());
832 assertTrue (aTuple3.names() == aTuple2.names());
833 assertTrue (aTuple3["string1"] == "");
834 assertTrue (aTuple3["int1"] == 0);
835 assertTrue (aTuple3["bool1"] == false);
836 assertTrue (aTuple3["char1"] == 0);
837 assertTrue (aTuple3["long1"] == 0);
838 assertTrue (aTuple3["short1"] == 0);
839 assertTrue (aTuple3["string2"] == "");
840 assertTrue (aTuple3["int2"] == 0);
841 assertTrue (aTuple3["string3"] == "");
842 assertTrue (aTuple3.length == 13);
843
844 assertTrue (aTuple.getName(0) == "string1");
845 aTuple.setName(0, "New Name");
846 assertTrue (aTuple.getName(0) == "New Name");
847
848 try { aTuple.setName(20, ""); fail("must fail"); }
849 catch (InvalidArgumentException&) { }
850}
851
852
853void NamedTuplesTest::testNamedTuple14()
854{
855 typedef NamedTuple<std::string,
856 int,
857 bool,
858 float,
859 char,
860 long,
861 double,
862 short,
863 std::string,
864 int,
865 std::string,
866 int,
867 bool,
868 float> TupleType;
869
870 TupleType aTuple;
871
872 assertTrue (aTuple["A"] == "");
873 assertTrue (aTuple["B"] == 0);
874 assertTrue (aTuple["C"] == false);
875 assertTrue (aTuple["E"] == 0);
876 assertTrue (aTuple["F"] == 0);
877 assertTrue (aTuple["H"] == 0);
878 assertTrue (aTuple["I"] == "");
879 assertTrue (aTuple["J"] == 0);
880 assertTrue (aTuple["K"] == "");
881 assertTrue (aTuple["L"] == 0);
882 assertTrue (aTuple["M"] == false);
883
884 try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
885 catch (NotFoundException&) { }
886 assertTrue (aTuple.length == 14);
887
888 TupleType aTuple2("string1", "1",
889 "int1", 1,
890 "bool1", true,
891 "float1", 1.5f,
892 "char1", 'c',
893 "long1", 999,
894 "double1", 1.5,
895 "short1", 32700,
896 "string2", "2",
897 "int2", 2,
898 "string3", "3",
899 "int3", 3,
900 "bool2", true,
901 "float2", 2.5);
902 assertTrue (aTuple2["string1"] == "1");
903 assertTrue (aTuple2["int1"] == 1);
904 assertTrue (aTuple2["bool1"] == true);
905 assertTrue (aTuple2["float1"] == 1.5);
906 assertTrue (aTuple2["char1"] == 'c');
907 assertTrue (aTuple2["long1"] == 999);
908 assertTrue (aTuple2["double1"] == 1.5);
909 assertTrue (aTuple2["short1"] == 32700);
910 assertTrue (aTuple2["string2"] == "2");
911 assertTrue (aTuple2["int2"] == 2);
912 assertTrue (aTuple2["string3"] == "3");
913 assertTrue (aTuple2["int3"] == 3);
914 assertTrue (aTuple2["bool2"] == true);
915 assertTrue (aTuple2["float2"] == 2.5);
916
917 assertTrue (aTuple != aTuple2);
918 aTuple = aTuple2;
919 assertTrue (aTuple == aTuple2);
920 aTuple2.get<1>()++;
921 assertTrue (aTuple < aTuple2);
922
923 TupleType aTuple3(aTuple2.names());
924 assertTrue (aTuple3.names() == aTuple2.names());
925 assertTrue (aTuple3["string1"] == "");
926 assertTrue (aTuple3["int1"] == 0);
927 assertTrue (aTuple3["bool1"] == false);
928 assertTrue (aTuple3["char1"] == 0);
929 assertTrue (aTuple3["long1"] == 0);
930 assertTrue (aTuple3["short1"] == 0);
931 assertTrue (aTuple3["string2"] == "");
932 assertTrue (aTuple3["int2"] == 0);
933 assertTrue (aTuple3["string3"] == "");
934 assertTrue (aTuple3["int3"] == 0);
935 assertTrue (aTuple3.length == 14);
936
937 assertTrue (aTuple.getName(0) == "string1");
938 aTuple.setName(0, "New Name");
939 assertTrue (aTuple.getName(0) == "New Name");
940
941 try { aTuple.setName(20, ""); fail("must fail"); }
942 catch (InvalidArgumentException&) { }
943}
944
945
946void NamedTuplesTest::testNamedTuple15()
947{
948 typedef NamedTuple<std::string,
949 int,
950 bool,
951 float,
952 char,
953 long,
954 double,
955 short,
956 std::string,
957 int,
958 std::string,
959 int,
960 bool,
961 float,
962 char> TupleType;
963
964 TupleType aTuple;
965
966 assertTrue (aTuple["A"] == "");
967 assertTrue (aTuple["B"] == 0);
968 assertTrue (aTuple["C"] == false);
969 assertTrue (aTuple["E"] == 0);
970 assertTrue (aTuple["F"] == 0);
971 assertTrue (aTuple["H"] == 0);
972 assertTrue (aTuple["I"] == "");
973 assertTrue (aTuple["J"] == 0);
974 assertTrue (aTuple["K"] == "");
975 assertTrue (aTuple["L"] == 0);
976 assertTrue (aTuple["M"] == false);
977
978 try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
979 catch (NotFoundException&) { }
980 assertTrue (aTuple.length == 15);
981
982 TupleType aTuple2("string1", "1",
983 "int1", 1,
984 "bool1", true,
985 "float1", 1.5f,
986 "char1", 'c',
987 "long1", 999,
988 "double1", 1.5,
989 "short1", 32700,
990 "string2", "2",
991 "int2", 2,
992 "string3", "3",
993 "int3", 3,
994 "bool2", true,
995 "float2", 2.5,
996 "char2", 'c');
997 assertTrue (aTuple2["string1"] == "1");
998 assertTrue (aTuple2["int1"] == 1);
999 assertTrue (aTuple2["bool1"] == true);
1000 assertTrue (aTuple2["float1"] == 1.5);
1001 assertTrue (aTuple2["char1"] == 'c');
1002 assertTrue (aTuple2["long1"] == 999);
1003 assertTrue (aTuple2["double1"] == 1.5);
1004 assertTrue (aTuple2["short1"] == 32700);
1005 assertTrue (aTuple2["string2"] == "2");
1006 assertTrue (aTuple2["int2"] == 2);
1007 assertTrue (aTuple2["string3"] == "3");
1008 assertTrue (aTuple2["int3"] == 3);
1009 assertTrue (aTuple2["bool2"] == true);
1010 assertTrue (aTuple2["float2"] == 2.5);
1011 assertTrue (aTuple2["char2"] == 'c');
1012
1013 assertTrue (aTuple != aTuple2);
1014 aTuple = aTuple2;
1015 assertTrue (aTuple == aTuple2);
1016 aTuple2.get<1>()++;
1017 assertTrue (aTuple < aTuple2);
1018
1019 TupleType aTuple3(aTuple2.names());
1020 assertTrue (aTuple3.names() == aTuple2.names());
1021 assertTrue (aTuple3["string1"] == "");
1022 assertTrue (aTuple3["int1"] == 0);
1023 assertTrue (aTuple3["bool1"] == false);
1024 assertTrue (aTuple3["char1"] == 0);
1025 assertTrue (aTuple3["long1"] == 0);
1026 assertTrue (aTuple3["short1"] == 0);
1027 assertTrue (aTuple3["string2"] == "");
1028 assertTrue (aTuple3["int2"] == 0);
1029 assertTrue (aTuple3["string3"] == "");
1030 assertTrue (aTuple3["int3"] == 0);
1031 assertTrue (aTuple3["bool2"] == false);
1032 assertTrue (aTuple3.length == 15);
1033
1034 assertTrue (aTuple.getName(0) == "string1");
1035 aTuple.setName(0, "New Name");
1036 assertTrue (aTuple.getName(0) == "New Name");
1037
1038 try { aTuple.setName(20, ""); fail("must fail"); }
1039 catch (InvalidArgumentException&) { }
1040}
1041
1042
1043void NamedTuplesTest::testNamedTuple16()
1044{
1045 typedef NamedTuple<std::string,
1046 int,
1047 bool,
1048 float,
1049 char,
1050 long,
1051 double,
1052 short,
1053 std::string,
1054 int,
1055 std::string,
1056 int,
1057 bool,
1058 float,
1059 char,
1060 long> TupleType;
1061
1062 TupleType aTuple;
1063
1064 assertTrue (aTuple["A"] == "");
1065 assertTrue (aTuple["B"] == 0);
1066 assertTrue (aTuple["C"] == false);
1067 assertTrue (aTuple["E"] == 0);
1068 assertTrue (aTuple["F"] == 0);
1069 assertTrue (aTuple["H"] == 0);
1070 assertTrue (aTuple["I"] == "");
1071 assertTrue (aTuple["J"] == 0);
1072 assertTrue (aTuple["K"] == "");
1073 assertTrue (aTuple["L"] == 0);
1074 assertTrue (aTuple["M"] == false);
1075 assertTrue (aTuple["O"] == 0);
1076
1077 try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
1078 catch (NotFoundException&) { }
1079 assertTrue (aTuple.length == 16);
1080
1081 TupleType aTuple2("string1", "1",
1082 "int1", 1,
1083 "bool1", true,
1084 "float1", 1.5f,
1085 "char1", 'c',
1086 "long1", 999,
1087 "double1", 1.5,
1088 "short1", 32700,
1089 "string2", "2",
1090 "int2", 2,
1091 "string3", "3",
1092 "int3", 3,
1093 "bool2", true,
1094 "float2", 2.5,
1095 "char2", 'c',
1096 "long2", 999);
1097 assertTrue (aTuple2["string1"] == "1");
1098 assertTrue (aTuple2["int1"] == 1);
1099 assertTrue (aTuple2["bool1"] == true);
1100 assertTrue (aTuple2["float1"] == 1.5);
1101 assertTrue (aTuple2["char1"] == 'c');
1102 assertTrue (aTuple2["long1"] == 999);
1103 assertTrue (aTuple2["double1"] == 1.5);
1104 assertTrue (aTuple2["short1"] == 32700);
1105 assertTrue (aTuple2["string2"] == "2");
1106 assertTrue (aTuple2["int2"] == 2);
1107 assertTrue (aTuple2["string3"] == "3");
1108 assertTrue (aTuple2["int3"] == 3);
1109 assertTrue (aTuple2["bool2"] == true);
1110 assertTrue (aTuple2["float2"] == 2.5);
1111 assertTrue (aTuple2["char2"] == 'c');
1112 assertTrue (aTuple2["long2"] == 999);
1113 assertTrue (aTuple2.length == 16);
1114
1115 assertTrue (aTuple != aTuple2);
1116 aTuple = aTuple2;
1117 assertTrue (aTuple == aTuple2);
1118 aTuple2.get<1>()++;
1119 assertTrue (aTuple < aTuple2);
1120
1121 TupleType aTuple3(aTuple2.names());
1122 assertTrue (aTuple3.names() == aTuple2.names());
1123 assertTrue (aTuple3["string1"] == "");
1124 assertTrue (aTuple3["int1"] == 0);
1125 assertTrue (aTuple3["bool1"] == false);
1126 assertTrue (aTuple3["char1"] == 0);
1127 assertTrue (aTuple3["long1"] == 0);
1128 assertTrue (aTuple3["short1"] == 0);
1129 assertTrue (aTuple3["string2"] == "");
1130 assertTrue (aTuple3["int2"] == 0);
1131 assertTrue (aTuple3["string3"] == "");
1132 assertTrue (aTuple3["int3"] == 0);
1133 assertTrue (aTuple3["bool2"] == false);
1134 assertTrue (aTuple3["char2"] == 0);
1135 assertTrue (aTuple3.length == 16);
1136
1137 assertTrue (aTuple.getName(0) == "string1");
1138 aTuple.setName(0, "New Name");
1139 assertTrue (aTuple.getName(0) == "New Name");
1140
1141 try { aTuple.setName(20, ""); fail("must fail"); }
1142 catch (InvalidArgumentException&) { }
1143}
1144
1145
1146void NamedTuplesTest::testNamedTuple17()
1147{
1148 typedef NamedTuple<std::string,
1149 int,
1150 bool,
1151 float,
1152 char,
1153 long,
1154 double,
1155 short,
1156 std::string,
1157 int,
1158 std::string,
1159 int,
1160 bool,
1161 float,
1162 char,
1163 long,
1164 double> TupleType;
1165
1166 TupleType aTuple;
1167
1168 assertTrue (aTuple["A"] == "");
1169 assertTrue (aTuple["B"] == 0);
1170 assertTrue (aTuple["C"] == false);
1171 assertTrue (aTuple["E"] == 0);
1172 assertTrue (aTuple["F"] == 0);
1173 assertTrue (aTuple["H"] == 0);
1174 assertTrue (aTuple["I"] == "");
1175 assertTrue (aTuple["J"] == 0);
1176 assertTrue (aTuple["K"] == "");
1177 assertTrue (aTuple["L"] == 0);
1178 assertTrue (aTuple["M"] == false);
1179 assertTrue (aTuple["O"] == 0);
1180 assertTrue (aTuple["P"] == 0);
1181
1182 try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
1183 catch (NotFoundException&) { }
1184 assertTrue (aTuple.length == 17);
1185
1186 TupleType aTuple2("string1", "1",
1187 "int1", 1,
1188 "bool1", true,
1189 "float1", 1.5f,
1190 "char1", 'c',
1191 "long1", 999,
1192 "double1", 1.5,
1193 "short1", 32700,
1194 "string2", "2",
1195 "int2", 2,
1196 "string3", "3",
1197 "int3", 3,
1198 "bool2", true,
1199 "float2", 2.5,
1200 "char2", 'c',
1201 "long2", 999,
1202 "double2", 2.5);
1203 assertTrue (aTuple2["string1"] == "1");
1204 assertTrue (aTuple2["int1"] == 1);
1205 assertTrue (aTuple2["bool1"] == true);
1206 assertTrue (aTuple2["float1"] == 1.5);
1207 assertTrue (aTuple2["char1"] == 'c');
1208 assertTrue (aTuple2["long1"] == 999);
1209 assertTrue (aTuple2["double1"] == 1.5);
1210 assertTrue (aTuple2["short1"] == 32700);
1211 assertTrue (aTuple2["string2"] == "2");
1212 assertTrue (aTuple2["int2"] == 2);
1213 assertTrue (aTuple2["string3"] == "3");
1214 assertTrue (aTuple2["int3"] == 3);
1215 assertTrue (aTuple2["bool2"] == true);
1216 assertTrue (aTuple2["float2"] == 2.5);
1217 assertTrue (aTuple2["char2"] == 'c');
1218 assertTrue (aTuple2["long2"] == 999);
1219 assertTrue (aTuple2["float2"] == 2.5);
1220 assertTrue (aTuple2.length == 17);
1221
1222 assertTrue (aTuple != aTuple2);
1223 aTuple = aTuple2;
1224 assertTrue (aTuple == aTuple2);
1225 aTuple2.get<1>()++;
1226 assertTrue (aTuple < aTuple2);
1227
1228 TupleType aTuple3(aTuple2.names());
1229 assertTrue (aTuple3.names() == aTuple2.names());
1230 assertTrue (aTuple3["string1"] == "");
1231 assertTrue (aTuple3["int1"] == 0);
1232 assertTrue (aTuple3["bool1"] == false);
1233 assertTrue (aTuple3["char1"] == 0);
1234 assertTrue (aTuple3["long1"] == 0);
1235 assertTrue (aTuple3["short1"] == 0);
1236 assertTrue (aTuple3["string2"] == "");
1237 assertTrue (aTuple3["int2"] == 0);
1238 assertTrue (aTuple3["string3"] == "");
1239 assertTrue (aTuple3["int3"] == 0);
1240 assertTrue (aTuple3["bool2"] == false);
1241 assertTrue (aTuple3["char2"] == 0);
1242 assertTrue (aTuple3["long2"] == 0);
1243 assertTrue (aTuple3.length == 17);
1244
1245 assertTrue (aTuple.getName(0) == "string1");
1246 aTuple.setName(0, "New Name");
1247 assertTrue (aTuple.getName(0) == "New Name");
1248
1249 try { aTuple.setName(20, ""); fail("must fail"); }
1250 catch (InvalidArgumentException&) { }
1251}
1252
1253
1254void NamedTuplesTest::testNamedTuple18()
1255{
1256 typedef NamedTuple<std::string,
1257 int,
1258 bool,
1259 float,
1260 char,
1261 long,
1262 double,
1263 short,
1264 std::string,
1265 int,
1266 std::string,
1267 int,
1268 bool,
1269 float,
1270 char,
1271 long,
1272 double,
1273 short> TupleType;
1274
1275 TupleType aTuple;
1276
1277 assertTrue (aTuple["A"] == "");
1278 assertTrue (aTuple["B"] == 0);
1279 assertTrue (aTuple["C"] == false);
1280 assertTrue (aTuple["E"] == 0);
1281 assertTrue (aTuple["F"] == 0);
1282 assertTrue (aTuple["H"] == 0);
1283 assertTrue (aTuple["I"] == "");
1284 assertTrue (aTuple["J"] == 0);
1285 assertTrue (aTuple["K"] == "");
1286 assertTrue (aTuple["L"] == 0);
1287 assertTrue (aTuple["M"] == false);
1288 assertTrue (aTuple["O"] == 0);
1289 assertTrue (aTuple["P"] == 0);
1290 assertTrue (aTuple["R"] == 0);
1291
1292 try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
1293 catch (NotFoundException&) { }
1294 assertTrue (aTuple.length == 18);
1295
1296 TupleType aTuple2("string1", "1",
1297 "int1", 1,
1298 "bool1", true,
1299 "float1", 1.5f,
1300 "char1", 'c',
1301 "long1", 999,
1302 "double1", 1.5,
1303 "short1", 32700,
1304 "string2", "2",
1305 "int2", 2,
1306 "string3", "3",
1307 "int3", 3,
1308 "bool2", true,
1309 "float2", 2.5,
1310 "char2", 'c',
1311 "long2", 999,
1312 "double2", 2.5,
1313 "short2", 32700);
1314 assertTrue (aTuple2["string1"] == "1");
1315 assertTrue (aTuple2["int1"] == 1);
1316 assertTrue (aTuple2["bool1"] == true);
1317 assertTrue (aTuple2["float1"] == 1.5);
1318 assertTrue (aTuple2["char1"] == 'c');
1319 assertTrue (aTuple2["long1"] == 999);
1320 assertTrue (aTuple2["double1"] == 1.5);
1321 assertTrue (aTuple2["short1"] == 32700);
1322 assertTrue (aTuple2["string2"] == "2");
1323 assertTrue (aTuple2["int2"] == 2);
1324 assertTrue (aTuple2["string3"] == "3");
1325 assertTrue (aTuple2["int3"] == 3);
1326 assertTrue (aTuple2["bool2"] == true);
1327 assertTrue (aTuple2["float2"] == 2.5);
1328 assertTrue (aTuple2["char2"] == 'c');
1329 assertTrue (aTuple2["long2"] == 999);
1330 assertTrue (aTuple2["float2"] == 2.5);
1331 assertTrue (aTuple2["short2"] == 32700);
1332 assertTrue (aTuple2.length == 18);
1333
1334 assertTrue (aTuple != aTuple2);
1335 aTuple = aTuple2;
1336 assertTrue (aTuple == aTuple2);
1337 aTuple2.get<1>()++;
1338 assertTrue (aTuple < aTuple2);
1339
1340 TupleType aTuple3(aTuple2.names());
1341 assertTrue (aTuple3.names() == aTuple2.names());
1342 assertTrue (aTuple3["string1"] == "");
1343 assertTrue (aTuple3["int1"] == 0);
1344 assertTrue (aTuple3["bool1"] == false);
1345 assertTrue (aTuple3["char1"] == 0);
1346 assertTrue (aTuple3["long1"] == 0);
1347 assertTrue (aTuple3["short1"] == 0);
1348 assertTrue (aTuple3["string2"] == "");
1349 assertTrue (aTuple3["int2"] == 0);
1350 assertTrue (aTuple3["string3"] == "");
1351 assertTrue (aTuple3["int3"] == 0);
1352 assertTrue (aTuple3["bool2"] == false);
1353 assertTrue (aTuple3["char2"] == 0);
1354 assertTrue (aTuple3["long2"] == 0);
1355 assertTrue (aTuple3["short2"] == 0);
1356 assertTrue (aTuple3.length == 18);
1357
1358 assertTrue (aTuple.getName(0) == "string1");
1359 aTuple.setName(0, "New Name");
1360 assertTrue (aTuple.getName(0) == "New Name");
1361
1362 try { aTuple.setName(20, ""); fail("must fail"); }
1363 catch (InvalidArgumentException&) { }
1364}
1365
1366
1367void NamedTuplesTest::testNamedTuple19()
1368{
1369 typedef NamedTuple<std::string,
1370 int,
1371 bool,
1372 float,
1373 char,
1374 long,
1375 double,
1376 short,
1377 std::string,
1378 int,
1379 std::string,
1380 int,
1381 bool,
1382 float,
1383 char,
1384 long,
1385 double,
1386 short,
1387 std::string> TupleType;
1388
1389 TupleType aTuple;
1390
1391 assertTrue (aTuple["A"] == "");
1392 assertTrue (aTuple["B"] == 0);
1393 assertTrue (aTuple["C"] == false);
1394 assertTrue (aTuple["E"] == 0);
1395 assertTrue (aTuple["F"] == 0);
1396 assertTrue (aTuple["H"] == 0);
1397 assertTrue (aTuple["I"] == "");
1398 assertTrue (aTuple["J"] == 0);
1399 assertTrue (aTuple["K"] == "");
1400 assertTrue (aTuple["L"] == 0);
1401 assertTrue (aTuple["M"] == false);
1402 assertTrue (aTuple["O"] == 0);
1403 assertTrue (aTuple["P"] == 0);
1404 assertTrue (aTuple["R"] == 0);
1405 assertTrue (aTuple["S"] == "");
1406
1407 try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
1408 catch (NotFoundException&) { }
1409 assertTrue (aTuple.length == 19);
1410
1411 TupleType aTuple2("string1", "1",
1412 "int1", 1,
1413 "bool1", true,
1414 "float1", 1.5f,
1415 "char1", 'c',
1416 "long1", 999,
1417 "double1", 1.5,
1418 "short1", 32700,
1419 "string2", "2",
1420 "int2", 2,
1421 "string3", "3",
1422 "int3", 3,
1423 "bool2", true,
1424 "float2", 2.5,
1425 "char2", 'c',
1426 "long2", 999,
1427 "double2", 2.5,
1428 "short2", 32700,
1429 "string4", "4");
1430 assertTrue (aTuple2["string1"] == "1");
1431 assertTrue (aTuple2["int1"] == 1);
1432 assertTrue (aTuple2["bool1"] == true);
1433 assertTrue (aTuple2["float1"] == 1.5);
1434 assertTrue (aTuple2["char1"] == 'c');
1435 assertTrue (aTuple2["long1"] == 999);
1436 assertTrue (aTuple2["double1"] == 1.5);
1437 assertTrue (aTuple2["short1"] == 32700);
1438 assertTrue (aTuple2["string2"] == "2");
1439 assertTrue (aTuple2["int2"] == 2);
1440 assertTrue (aTuple2["string3"] == "3");
1441 assertTrue (aTuple2["int3"] == 3);
1442 assertTrue (aTuple2["bool2"] == true);
1443 assertTrue (aTuple2["float2"] == 2.5);
1444 assertTrue (aTuple2["char2"] == 'c');
1445 assertTrue (aTuple2["long2"] == 999);
1446 assertTrue (aTuple2["float2"] == 2.5);
1447 assertTrue (aTuple2["short2"] == 32700);
1448 assertTrue (aTuple2["string4"] == "4");
1449 assertTrue (aTuple2.length == 19);
1450
1451 assertTrue (aTuple != aTuple2);
1452 aTuple = aTuple2;
1453 assertTrue (aTuple == aTuple2);
1454 aTuple2.get<1>()++;
1455 assertTrue (aTuple < aTuple2);
1456
1457 TupleType aTuple3(aTuple2.names());
1458 assertTrue (aTuple3.names() == aTuple2.names());
1459 assertTrue (aTuple3["string1"] == "");
1460 assertTrue (aTuple3["int1"] == 0);
1461 assertTrue (aTuple3["bool1"] == false);
1462 assertTrue (aTuple3["char1"] == 0);
1463 assertTrue (aTuple3["long1"] == 0);
1464 assertTrue (aTuple3["short1"] == 0);
1465 assertTrue (aTuple3["string2"] == "");
1466 assertTrue (aTuple3["int2"] == 0);
1467 assertTrue (aTuple3["string3"] == "");
1468 assertTrue (aTuple3["int3"] == 0);
1469 assertTrue (aTuple3["bool2"] == false);
1470 assertTrue (aTuple3["char2"] == 0);
1471 assertTrue (aTuple3["long2"] == 0);
1472 assertTrue (aTuple3["short2"] == 0);
1473 assertTrue (aTuple3["string4"] == "");
1474 assertTrue (aTuple3.length == 19);
1475
1476 assertTrue (aTuple.getName(0) == "string1");
1477 aTuple.setName(0, "New Name");
1478 assertTrue (aTuple.getName(0) == "New Name");
1479
1480 try { aTuple.setName(20, ""); fail("must fail"); }
1481 catch (InvalidArgumentException&) { }
1482}
1483
1484
1485void NamedTuplesTest::testNamedTuple20()
1486{
1487 typedef NamedTuple<std::string,
1488 int,
1489 bool,
1490 float,
1491 char,
1492 long,
1493 double,
1494 short,
1495 std::string,
1496 int,
1497 std::string,
1498 int,
1499 bool,
1500 float,
1501 char,
1502 long,
1503 double,
1504 short,
1505 std::string,
1506 int> TupleType;
1507
1508 TupleType aTuple;
1509
1510 assertTrue (aTuple["A"] == "");
1511 assertTrue (aTuple["B"] == 0);
1512 assertTrue (aTuple["C"] == false);
1513 assertTrue (aTuple["E"] == 0);
1514 assertTrue (aTuple["F"] == 0);
1515 assertTrue (aTuple["H"] == 0);
1516 assertTrue (aTuple["I"] == "");
1517 assertTrue (aTuple["J"] == 0);
1518 assertTrue (aTuple["K"] == "");
1519 assertTrue (aTuple["L"] == 0);
1520 assertTrue (aTuple["M"] == false);
1521 assertTrue (aTuple["O"] == 0);
1522 assertTrue (aTuple["P"] == 0);
1523 assertTrue (aTuple["R"] == 0);
1524 assertTrue (aTuple["S"] == "");
1525 assertTrue (aTuple["T"] == 0);
1526 try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
1527 catch (NotFoundException&) { }
1528 assertTrue (aTuple.length == 20);
1529
1530
1531 TupleType aTuple2("string1", "1",
1532 "int1", 1,
1533 "bool1", true,
1534 "float1", 1.5f,
1535 "char1", 'c',
1536 "long1", 999,
1537 "double1", 1.5,
1538 "short1", 32700,
1539 "string2", "2",
1540 "int2", 2,
1541 "string3", "3",
1542 "int3", 3,
1543 "bool2", true,
1544 "float2", 2.5,
1545 "char2", 'c',
1546 "long2", 999,
1547 "double2", 2.5,
1548 "short2", 32700,
1549 "string4", "4",
1550 "int4", 4);
1551 assertTrue (aTuple2["string1"] == "1");
1552 assertTrue (aTuple2["int1"] == 1);
1553 assertTrue (aTuple2["bool1"] == true);
1554 assertTrue (aTuple2["float1"] == 1.5);
1555 assertTrue (aTuple2["char1"] == 'c');
1556 assertTrue (aTuple2["long1"] == 999);
1557 assertTrue (aTuple2["double1"] == 1.5);
1558 assertTrue (aTuple2["short1"] == 32700);
1559 assertTrue (aTuple2["string2"] == "2");
1560 assertTrue (aTuple2["int2"] == 2);
1561 assertTrue (aTuple2["string3"] == "3");
1562 assertTrue (aTuple2["int3"] == 3);
1563 assertTrue (aTuple2["bool2"] == true);
1564 assertTrue (aTuple2["float2"] == 2.5);
1565 assertTrue (aTuple2["char2"] == 'c');
1566 assertTrue (aTuple2["long2"] == 999);
1567 assertTrue (aTuple2["float2"] == 2.5);
1568 assertTrue (aTuple2["short2"] == 32700);
1569 assertTrue (aTuple2["string4"] == "4");
1570 assertTrue (aTuple2["int4"] == 4);
1571 assertTrue (aTuple2.length == 20);
1572
1573 assertTrue (aTuple != aTuple2);
1574 aTuple = aTuple2;
1575 assertTrue (aTuple == aTuple2);
1576 aTuple2.get<1>()++;
1577 assertTrue (aTuple < aTuple2);
1578
1579 TupleType aTuple3(aTuple2.names());
1580 assertTrue (aTuple3.names() == aTuple2.names());
1581 assertTrue (aTuple3["string1"] == "");
1582 assertTrue (aTuple3["int1"] == 0);
1583 assertTrue (aTuple3["bool1"] == false);
1584 assertTrue (aTuple3["char1"] == 0);
1585 assertTrue (aTuple3["long1"] == 0);
1586 assertTrue (aTuple3["short1"] == 0);
1587 assertTrue (aTuple3["string2"] == "");
1588 assertTrue (aTuple3["int2"] == 0);
1589 assertTrue (aTuple3["string3"] == "");
1590 assertTrue (aTuple3["int3"] == 0);
1591 assertTrue (aTuple3["bool2"] == false);
1592 assertTrue (aTuple3["char2"] == 0);
1593 assertTrue (aTuple3["long2"] == 0);
1594 assertTrue (aTuple3["short2"] == 0);
1595 assertTrue (aTuple3["string4"] == "");
1596 assertTrue (aTuple3["int4"] == 0);
1597 assertTrue (aTuple3.length == 20);
1598
1599 assertTrue (aTuple.getName(0) == "string1");
1600 aTuple.setName(0, "New Name");
1601 assertTrue (aTuple.getName(0) == "New Name");
1602
1603 try { aTuple.setName(20, ""); fail("must fail"); }
1604 catch (InvalidArgumentException&) { }
1605}
1606
1607
1608void NamedTuplesTest::testNamedTuple21()
1609{
1610 typedef NamedTuple<std::string,
1611 int,
1612 bool,
1613 float,
1614 char,
1615 long,
1616 double,
1617 short,
1618 std::string,
1619 int,
1620 std::string,
1621 int,
1622 bool,
1623 float,
1624 char,
1625 long,
1626 double,
1627 short,
1628 std::string,
1629 int,
1630 bool> TupleType;
1631
1632 TupleType aTuple;
1633
1634 assertTrue (aTuple["A"] == "");
1635 assertTrue (aTuple["B"] == 0);
1636 assertTrue (aTuple["C"] == false);
1637 assertTrue (aTuple["E"] == 0);
1638 assertTrue (aTuple["F"] == 0);
1639 assertTrue (aTuple["H"] == 0);
1640 assertTrue (aTuple["I"] == "");
1641 assertTrue (aTuple["J"] == 0);
1642 assertTrue (aTuple["K"] == "");
1643 assertTrue (aTuple["L"] == 0);
1644 assertTrue (aTuple["M"] == false);
1645 assertTrue (aTuple["O"] == 0);
1646 assertTrue (aTuple["P"] == 0);
1647 assertTrue (aTuple["R"] == 0);
1648 assertTrue (aTuple["S"] == "");
1649 assertTrue (aTuple["T"] == 0);
1650 assertTrue (aTuple["U"] == false);
1651 try { int POCO_UNUSED xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
1652 catch (NotFoundException&) { }
1653 assertTrue (aTuple.length == 21);
1654
1655 TupleType aTuple2("string1", "1",
1656 "int1", 1,
1657 "bool1", true,
1658 "float1", 1.5f,
1659 "char1", 'c',
1660 "long1", 999,
1661 "double1", 1.5,
1662 "short1", 32700,
1663 "string2", "2",
1664 "int2", 2,
1665 "string3", "3",
1666 "int3", 3,
1667 "bool2", true,
1668 "float2", 2.5,
1669 "char2", 'c',
1670 "long2", 999,
1671 "double2", 2.5,
1672 "short2", 32700,
1673 "string4", "4",
1674 "int4", 4,
1675 "bool3", true);
1676 assertTrue (aTuple2["string1"] == "1");
1677 assertTrue (aTuple2["int1"] == 1);
1678 assertTrue (aTuple2["bool1"] == true);
1679 assertTrue (aTuple2["float1"] == 1.5);
1680 assertTrue (aTuple2["char1"] == 'c');
1681 assertTrue (aTuple2["long1"] == 999);
1682 assertTrue (aTuple2["double1"] == 1.5);
1683 assertTrue (aTuple2["short1"] == 32700);
1684 assertTrue (aTuple2["string2"] == "2");
1685 assertTrue (aTuple2["int2"] == 2);
1686 assertTrue (aTuple2["string3"] == "3");
1687 assertTrue (aTuple2["int3"] == 3);
1688 assertTrue (aTuple2["bool2"] == true);
1689 assertTrue (aTuple2["float2"] == 2.5);
1690 assertTrue (aTuple2["char2"] == 'c');
1691 assertTrue (aTuple2["long2"] == 999);
1692 assertTrue (aTuple2["float2"] == 2.5);
1693 assertTrue (aTuple2["short2"] == 32700);
1694 assertTrue (aTuple2["string4"] == "4");
1695 assertTrue (aTuple2["int4"] == 4);
1696 assertTrue (aTuple2["bool3"] == true);
1697 assertTrue (aTuple2.length == 21);
1698
1699 assertTrue (aTuple != aTuple2);
1700 aTuple = aTuple2;
1701 assertTrue (aTuple == aTuple2);
1702 aTuple2.get<1>()++;
1703 assertTrue (aTuple < aTuple2);
1704
1705 TupleType aTuple3(aTuple2.names());
1706 assertTrue (aTuple3.names() == aTuple2.names());
1707 assertTrue (aTuple3["string1"] == "");
1708 assertTrue (aTuple3["int1"] == 0);
1709 assertTrue (aTuple3["bool1"] == false);
1710 assertTrue (aTuple3["char1"] == 0);
1711 assertTrue (aTuple3["long1"] == 0);
1712 assertTrue (aTuple3["short1"] == 0);
1713 assertTrue (aTuple3["string2"] == "");
1714 assertTrue (aTuple3["int2"] == 0);
1715 assertTrue (aTuple3["string3"] == "");
1716 assertTrue (aTuple3["int3"] == 0);
1717 assertTrue (aTuple3["bool2"] == false);
1718 assertTrue (aTuple3["char2"] == 0);
1719 assertTrue (aTuple3["long2"] == 0);
1720 assertTrue (aTuple3["short2"] == 0);
1721 assertTrue (aTuple3["string4"] == "");
1722 assertTrue (aTuple3["int4"] == 0);
1723 assertTrue (aTuple3["bool3"] == false);
1724 assertTrue (aTuple3.length == 21);
1725
1726 assertTrue (aTuple.getName(0) == "string1");
1727 aTuple.setName(0, "New Name");
1728 assertTrue (aTuple.getName(0) == "New Name");
1729
1730 try { aTuple.setName(21, ""); fail("must fail"); }
1731 catch (InvalidArgumentException&) { }
1732}
1733
1734
1735void NamedTuplesTest::testNamedTuple22()
1736{
1737 typedef NamedTuple<std::string, // 0,A
1738 int, // 1, B
1739 bool, // 2, C
1740 float, // 3, D
1741 char, // 4, E
1742 long, // 5, F
1743 double, // 6, G
1744 short, // 7, H
1745 std::string, // 8, I
1746 int, // 9, J
1747 std::string, // 10, K
1748 int, // 11, L
1749 bool, // 12, M
1750 float, // 13, N
1751 char, // 14, O
1752 long, // 15, P
1753 double, // 16, Q
1754 short, // 17, R
1755 std::string, // 18, S
1756 int, // 19, T
1757 std::string, //20, U
1758 int
1759 > TupleType;
1760
1761 TupleType aTuple;
1762
1763 assertTrue (aTuple["A"] == "");
1764 assertTrue (aTuple["B"] == 0);
1765 assertTrue (aTuple["C"] == false);
1766 assertTrue (aTuple["E"] == 0);
1767 assertTrue (aTuple["F"] == 0);
1768 assertTrue (aTuple["H"] == 0);
1769 assertTrue (aTuple["I"] == "");
1770 assertTrue (aTuple["J"] == 0);
1771 assertTrue (aTuple["K"] == "");
1772 assertTrue (aTuple["L"] == 0);
1773 assertTrue (aTuple["M"] == false);
1774 assertTrue (aTuple["O"] == 0);
1775 assertTrue (aTuple["P"] == 0);
1776 assertTrue (aTuple["R"] == 0);
1777 assertTrue (aTuple["S"] == "");
1778 assertTrue (aTuple["T"] == 0);
1779 assertTrue (aTuple["U"] == "");
1780 assertTrue (aTuple["V"] == 0);
1781
1782 try { int POCO_UNUSED xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
1783 catch (NotFoundException&) { }
1784 assertTrue (aTuple.length == 22);
1785
1786 TupleType aTuple2("string1", "1",
1787 "int1", 1,
1788 "bool1", true,
1789 "float1", 1.5f,
1790 "char1", 'c',
1791 "long1", 999,
1792 "double1", 1.5,
1793 "short1", 32700,
1794 "string2", "2",
1795 "int2", 2,
1796 "string3", "3",
1797 "int3", 3,
1798 "bool2", true,
1799 "float2", 2.5,
1800 "char2", 'c',
1801 "long2", 999,
1802 "double2", 2.5,
1803 "short2", 32700,
1804 "string4", "4",
1805 "int4", 4,
1806 "string5", "5",
1807 "int5", 5);
1808 assertTrue (aTuple2["string1"] == "1");
1809 assertTrue (aTuple2["int1"] == 1);
1810 assertTrue (aTuple2["bool1"] == true);
1811 assertTrue (aTuple2["float1"] == 1.5);
1812 assertTrue (aTuple2["char1"] == 'c');
1813 assertTrue (aTuple2["long1"] == 999);
1814 assertTrue (aTuple2["double1"] == 1.5);
1815 assertTrue (aTuple2["short1"] == 32700);
1816 assertTrue (aTuple2["string2"] == "2");
1817 assertTrue (aTuple2["int2"] == 2);
1818 assertTrue (aTuple2["string3"] == "3");
1819 assertTrue (aTuple2["int3"] == 3);
1820 assertTrue (aTuple2["bool2"] == true);
1821 assertTrue (aTuple2["float2"] == 2.5);
1822 assertTrue (aTuple2["char2"] == 'c');
1823 assertTrue (aTuple2["long2"] == 999);
1824 assertTrue (aTuple2["float2"] == 2.5);
1825 assertTrue (aTuple2["short2"] == 32700);
1826 assertTrue (aTuple2["string4"] == "4");
1827 assertTrue (aTuple2["int4"] == 4);
1828 assertTrue (aTuple2["string5"] == "5");
1829 assertTrue (aTuple2["int5"] == 5);
1830 assertTrue (aTuple2.length == 22);
1831
1832 assertTrue (aTuple != aTuple2);
1833 aTuple = aTuple2;
1834 assertTrue (aTuple == aTuple2);
1835 aTuple2.get<1>()++;
1836 assertTrue (aTuple < aTuple2);
1837
1838 TupleType aTuple3(aTuple2.names());
1839 assertTrue (aTuple3.names() == aTuple2.names());
1840 assertTrue (aTuple3["string1"] == "");
1841 assertTrue (aTuple3["int1"] == 0);
1842 assertTrue (aTuple3["bool1"] == false);
1843 assertTrue (aTuple3["char1"] == 0);
1844 assertTrue (aTuple3["long1"] == 0);
1845 assertTrue (aTuple3["short1"] == 0);
1846 assertTrue (aTuple3["string2"] == "");
1847 assertTrue (aTuple3["int2"] == 0);
1848 assertTrue (aTuple3["string3"] == "");
1849 assertTrue (aTuple3["int3"] == 0);
1850 assertTrue (aTuple3["bool2"] == false);
1851 assertTrue (aTuple3["char2"] == 0);
1852 assertTrue (aTuple3["long2"] == 0);
1853 assertTrue (aTuple3["short2"] == 0);
1854 assertTrue (aTuple3["string4"] == "");
1855 assertTrue (aTuple3["int4"] == 0);
1856 assertTrue (aTuple3["string5"] == "");
1857 assertTrue (aTuple3["int5"] == 0);
1858 assertTrue (aTuple3.length == 22);
1859
1860 assertTrue (aTuple.getName(0) == "string1");
1861 aTuple.setName(0, "New Name");
1862 assertTrue (aTuple.getName(0) == "New Name");
1863
1864 try { aTuple.setName(30, ""); fail("must fail"); }
1865 catch (InvalidArgumentException&) { }
1866}
1867
1868
1869void NamedTuplesTest::testNamedTuple23()
1870{
1871 typedef NamedTuple<std::string, // 0,A
1872 int, // 1, B
1873 bool, // 2, C
1874 float, // 3, D
1875 char, // 4, E
1876 long, // 5, F
1877 double, // 6, G
1878 short, // 7, H
1879 std::string, // 8, I
1880 int, // 9, J
1881 std::string, // 10, K
1882 int, // 11, L
1883 bool, // 12, M
1884 float, // 13, N
1885 char, // 14, O
1886 long, // 15, P
1887 double, // 16, Q
1888 short, // 17, R
1889 std::string, // 18, S
1890 int, // 19, T
1891 std::string, //20, U
1892 int, // 21, V
1893 bool> TupleType;
1894
1895 TupleType aTuple;
1896
1897 assertTrue (aTuple["A"] == "");
1898 assertTrue (aTuple["B"] == 0);
1899 assertTrue (aTuple["C"] == false);
1900 assertTrue (aTuple["E"] == 0);
1901 assertTrue (aTuple["F"] == 0);
1902 assertTrue (aTuple["H"] == 0);
1903 assertTrue (aTuple["I"] == "");
1904 assertTrue (aTuple["J"] == 0);
1905 assertTrue (aTuple["K"] == "");
1906 assertTrue (aTuple["L"] == 0);
1907 assertTrue (aTuple["M"] == false);
1908 assertTrue (aTuple["O"] == 0);
1909 assertTrue (aTuple["P"] == 0);
1910 assertTrue (aTuple["R"] == 0);
1911 assertTrue (aTuple["S"] == "");
1912 assertTrue (aTuple["T"] == 0);
1913 assertTrue (aTuple["U"] == "");
1914 assertTrue (aTuple["V"] == 0);
1915 assertTrue (aTuple["W"] == false);
1916
1917 try { int POCO_UNUSED xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
1918 catch (NotFoundException&) { }
1919 assertTrue (aTuple.length == 23);
1920
1921 TupleType aTuple2("string1", "1",
1922 "int1", 1,
1923 "bool1", true,
1924 "float1", 1.5f,
1925 "char1", 'c',
1926 "long1", 999,
1927 "double1", 1.5,
1928 "short1", 32700,
1929 "string2", "2",
1930 "int2", 2,
1931 "string3", "3",
1932 "int3", 3,
1933 "bool2", true,
1934 "float2", 2.5,
1935 "char2", 'c',
1936 "long2", 999,
1937 "double2", 2.5,
1938 "short2", 32700,
1939 "string4", "4",
1940 "int4", 4,
1941 "string5", "5",
1942 "int5", 5,
1943 "bool3", true);
1944 assertTrue (aTuple2["string1"] == "1");
1945 assertTrue (aTuple2["int1"] == 1);
1946 assertTrue (aTuple2["bool1"] == true);
1947 assertTrue (aTuple2["float1"] == 1.5);
1948 assertTrue (aTuple2["char1"] == 'c');
1949 assertTrue (aTuple2["long1"] == 999);
1950 assertTrue (aTuple2["double1"] == 1.5);
1951 assertTrue (aTuple2["short1"] == 32700);
1952 assertTrue (aTuple2["string2"] == "2");
1953 assertTrue (aTuple2["int2"] == 2);
1954 assertTrue (aTuple2["string3"] == "3");
1955 assertTrue (aTuple2["int3"] == 3);
1956 assertTrue (aTuple2["bool2"] == true);
1957 assertTrue (aTuple2["float2"] == 2.5);
1958 assertTrue (aTuple2["char2"] == 'c');
1959 assertTrue (aTuple2["long2"] == 999);
1960 assertTrue (aTuple2["float2"] == 2.5);
1961 assertTrue (aTuple2["short2"] == 32700);
1962 assertTrue (aTuple2["string4"] == "4");
1963 assertTrue (aTuple2["int4"] == 4);
1964 assertTrue (aTuple2["string5"] == "5");
1965 assertTrue (aTuple2["int5"] == 5);
1966 assertTrue (aTuple2["bool3"] == true);
1967 assertTrue (aTuple2.length == 23);
1968
1969 assertTrue (aTuple != aTuple2);
1970 aTuple = aTuple2;
1971 assertTrue (aTuple == aTuple2);
1972 aTuple2.get<1>()++;
1973 assertTrue (aTuple < aTuple2);
1974
1975 TupleType aTuple3(aTuple2.names());
1976 assertTrue (aTuple3.names() == aTuple2.names());
1977 assertTrue (aTuple3["string1"] == "");
1978 assertTrue (aTuple3["int1"] == 0);
1979 assertTrue (aTuple3["bool1"] == false);
1980 assertTrue (aTuple3["char1"] == 0);
1981 assertTrue (aTuple3["long1"] == 0);
1982 assertTrue (aTuple3["short1"] == 0);
1983 assertTrue (aTuple3["string2"] == "");
1984 assertTrue (aTuple3["int2"] == 0);
1985 assertTrue (aTuple3["string3"] == "");
1986 assertTrue (aTuple3["int3"] == 0);
1987 assertTrue (aTuple3["bool2"] == false);
1988 assertTrue (aTuple3["char2"] == 0);
1989 assertTrue (aTuple3["long2"] == 0);
1990 assertTrue (aTuple3["short2"] == 0);
1991 assertTrue (aTuple3["string4"] == "");
1992 assertTrue (aTuple3["int4"] == 0);
1993 assertTrue (aTuple3["string5"] == "");
1994 assertTrue (aTuple3["int5"] == 0);
1995 assertTrue (aTuple3["bool3"] == false);
1996 assertTrue (aTuple3.length == 23);
1997
1998 assertTrue (aTuple.getName(0) == "string1");
1999 aTuple.setName(0, "New Name");
2000 assertTrue (aTuple.getName(0) == "New Name");
2001
2002 try { aTuple.setName(30, ""); fail("must fail"); }
2003 catch (InvalidArgumentException&) { }
2004}
2005
2006
2007void NamedTuplesTest::testNamedTuple24()
2008{
2009 typedef NamedTuple<std::string, // 0,A
2010 int, // 1, B
2011 bool, // 2, C
2012 float, // 3, D
2013 char, // 4, E
2014 long, // 5, F
2015 double, // 6, G
2016 short, // 7, H
2017 std::string, // 8, I
2018 int, // 9, J
2019 std::string, // 10, K
2020 int, // 11, L
2021 bool, // 12, M
2022 float, // 13, N
2023 char, // 14, O
2024 long, // 15, P
2025 double, // 16, Q
2026 short, // 17, R
2027 std::string, // 18, S
2028 int, // 19, T
2029 std::string, //20, U
2030 int, // 21, V
2031 bool, // 22, W
2032 float> TupleType;
2033
2034 TupleType aTuple;
2035
2036 assertTrue (aTuple["A"] == "");
2037 assertTrue (aTuple["B"] == 0);
2038 assertTrue (aTuple["C"] == false);
2039 assertTrue (aTuple["E"] == 0);
2040 assertTrue (aTuple["F"] == 0);
2041 assertTrue (aTuple["H"] == 0);
2042 assertTrue (aTuple["I"] == "");
2043 assertTrue (aTuple["J"] == 0);
2044 assertTrue (aTuple["K"] == "");
2045 assertTrue (aTuple["L"] == 0);
2046 assertTrue (aTuple["M"] == false);
2047 assertTrue (aTuple["O"] == 0);
2048 assertTrue (aTuple["P"] == 0);
2049 assertTrue (aTuple["R"] == 0);
2050 assertTrue (aTuple["S"] == "");
2051 assertTrue (aTuple["T"] == 0);
2052 assertTrue (aTuple["U"] == "");
2053 assertTrue (aTuple["V"] == 0);
2054 assertTrue (aTuple["W"] == false);
2055 assertTrue (aTuple["X"] == 0);
2056
2057 try { int POCO_UNUSED xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
2058 catch (NotFoundException&) { }
2059 assertTrue (aTuple.length == 24);
2060
2061 TupleType aTuple2("string1", "1",
2062 "int1", 1,
2063 "bool1", true,
2064 "float1", 1.5f,
2065 "char1", 'c',
2066 "long1", 999,
2067 "double1", 1.5,
2068 "short1", 32700,
2069 "string2", "2",
2070 "int2", 2,
2071 "string3", "3",
2072 "int3", 3,
2073 "bool2", true,
2074 "float2", 2.5,
2075 "char2", 'c',
2076 "long2", 999,
2077 "double2", 2.5,
2078 "short2", 32700,
2079 "string4", "4",
2080 "int4", 4,
2081 "string5", "5",
2082 "int5", 5,
2083 "bool3", true,
2084 "float3", 3.5f);
2085 assertTrue (aTuple2["string1"] == "1");
2086 assertTrue (aTuple2["int1"] == 1);
2087 assertTrue (aTuple2["bool1"] == true);
2088 assertTrue (aTuple2["float1"] == 1.5);
2089 assertTrue (aTuple2["char1"] == 'c');
2090 assertTrue (aTuple2["long1"] == 999);
2091 assertTrue (aTuple2["double1"] == 1.5);
2092 assertTrue (aTuple2["short1"] == 32700);
2093 assertTrue (aTuple2["string2"] == "2");
2094 assertTrue (aTuple2["int2"] == 2);
2095 assertTrue (aTuple2["string3"] == "3");
2096 assertTrue (aTuple2["int3"] == 3);
2097 assertTrue (aTuple2["bool2"] == true);
2098 assertTrue (aTuple2["float2"] == 2.5);
2099 assertTrue (aTuple2["char2"] == 'c');
2100 assertTrue (aTuple2["long2"] == 999);
2101 assertTrue (aTuple2["float2"] == 2.5);
2102 assertTrue (aTuple2["short2"] == 32700);
2103 assertTrue (aTuple2["string4"] == "4");
2104 assertTrue (aTuple2["int4"] == 4);
2105 assertTrue (aTuple2["string5"] == "5");
2106 assertTrue (aTuple2["int5"] == 5);
2107 assertTrue (aTuple2["bool3"] == true);
2108 assertTrue (aTuple2["float3"] == 3.5);
2109 assertTrue (aTuple2.length == 24);
2110
2111 assertTrue (aTuple != aTuple2);
2112 aTuple = aTuple2;
2113 assertTrue (aTuple == aTuple2);
2114 aTuple2.get<1>()++;
2115 assertTrue (aTuple < aTuple2);
2116
2117 TupleType aTuple3(aTuple2.names());
2118 assertTrue (aTuple3.names() == aTuple2.names());
2119 assertTrue (aTuple3["string1"] == "");
2120 assertTrue (aTuple3["int1"] == 0);
2121 assertTrue (aTuple3["bool1"] == false);
2122 assertTrue (aTuple3["char1"] == 0);
2123 assertTrue (aTuple3["long1"] == 0);
2124 assertTrue (aTuple3["short1"] == 0);
2125 assertTrue (aTuple3["string2"] == "");
2126 assertTrue (aTuple3["int2"] == 0);
2127 assertTrue (aTuple3["string3"] == "");
2128 assertTrue (aTuple3["int3"] == 0);
2129 assertTrue (aTuple3["bool2"] == false);
2130 assertTrue (aTuple3["char2"] == 0);
2131 assertTrue (aTuple3["long2"] == 0);
2132 assertTrue (aTuple3["short2"] == 0);
2133 assertTrue (aTuple3["string4"] == "");
2134 assertTrue (aTuple3["int4"] == 0);
2135 assertTrue (aTuple3["string5"] == "");
2136 assertTrue (aTuple3["int5"] == 0);
2137 assertTrue (aTuple3.length == 24);
2138
2139 assertTrue (aTuple.getName(0) == "string1");
2140 aTuple.setName(0, "New Name");
2141 assertTrue (aTuple.getName(0) == "New Name");
2142
2143 try { aTuple.setName(30, ""); fail("must fail"); }
2144 catch (InvalidArgumentException&) { }
2145}
2146
2147
2148void NamedTuplesTest::testNamedTuple25()
2149{
2150 typedef NamedTuple<std::string, // 0,A
2151 int, // 1, B
2152 bool, // 2, C
2153 float, // 3, D
2154 char, // 4, E
2155 long, // 5, F
2156 double, // 6, G
2157 short, // 7, H
2158 std::string, // 8, I
2159 int, // 9, J
2160 std::string, // 10, K
2161 int, // 11, L
2162 bool, // 12, M
2163 float, // 13, N
2164 char, // 14, O
2165 long, // 15, P
2166 double, // 16, Q
2167 short, // 17, R
2168 std::string, // 18, S
2169 int, // 19, T
2170 std::string, //20, U
2171 int, // 21, V
2172 bool, // 22, W
2173 float, //23, X
2174 char // 24, Y
2175 > TupleType;
2176
2177 TupleType aTuple;
2178
2179 assertTrue (aTuple["A"] == "");
2180 assertTrue (aTuple["B"] == 0);
2181 assertTrue (aTuple["C"] == false);
2182 assertTrue (aTuple["E"] == 0);
2183 assertTrue (aTuple["F"] == 0);
2184 assertTrue (aTuple["H"] == 0);
2185 assertTrue (aTuple["I"] == "");
2186 assertTrue (aTuple["J"] == 0);
2187 assertTrue (aTuple["K"] == "");
2188 assertTrue (aTuple["L"] == 0);
2189 assertTrue (aTuple["M"] == false);
2190 assertTrue (aTuple["O"] == 0);
2191 assertTrue (aTuple["P"] == 0);
2192 assertTrue (aTuple["R"] == 0);
2193 assertTrue (aTuple["S"] == "");
2194 assertTrue (aTuple["T"] == 0);
2195 assertTrue (aTuple["U"] == "");
2196 assertTrue (aTuple["V"] == 0);
2197 assertTrue (aTuple["W"] == false);
2198 assertTrue (aTuple["Y"] == 0);
2199
2200 try { int POCO_UNUSED xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
2201 catch (NotFoundException&) { }
2202 assertTrue (aTuple.length == 25);
2203
2204 TupleType aTuple2("string1", "1",
2205 "int1", 1,
2206 "bool1", true,
2207 "float1", 1.5f,
2208 "char1", 'c',
2209 "long1", 999,
2210 "double1", 1.5,
2211 "short1", 32700,
2212 "string2", "2",
2213 "int2", 2,
2214 "string3", "3",
2215 "int3", 3,
2216 "bool2", true,
2217 "float2", 2.5,
2218 "char2", 'c',
2219 "long2", 999,
2220 "double2", 2.5,
2221 "short2", 32700,
2222 "string4", "4",
2223 "int4", 4,
2224 "string5", "5",
2225 "int5", 5,
2226 "bool3", true,
2227 "float3", 3.5f,
2228 "char3", 'c');
2229 assertTrue (aTuple2["string1"] == "1");
2230 assertTrue (aTuple2["int1"] == 1);
2231 assertTrue (aTuple2["bool1"] == true);
2232 assertTrue (aTuple2["float1"] == 1.5);
2233 assertTrue (aTuple2["char1"] == 'c');
2234 assertTrue (aTuple2["long1"] == 999);
2235 assertTrue (aTuple2["double1"] == 1.5);
2236 assertTrue (aTuple2["short1"] == 32700);
2237 assertTrue (aTuple2["string2"] == "2");
2238 assertTrue (aTuple2["int2"] == 2);
2239 assertTrue (aTuple2["string3"] == "3");
2240 assertTrue (aTuple2["int3"] == 3);
2241 assertTrue (aTuple2["bool2"] == true);
2242 assertTrue (aTuple2["float2"] == 2.5);
2243 assertTrue (aTuple2["char2"] == 'c');
2244 assertTrue (aTuple2["long2"] == 999);
2245 assertTrue (aTuple2["float2"] == 2.5);
2246 assertTrue (aTuple2["short2"] == 32700);
2247 assertTrue (aTuple2["string4"] == "4");
2248 assertTrue (aTuple2["int4"] == 4);
2249 assertTrue (aTuple2["string5"] == "5");
2250 assertTrue (aTuple2["int5"] == 5);
2251 assertTrue (aTuple2["bool3"] == true);
2252 assertTrue (aTuple2["float3"] == 3.5);
2253 assertTrue (aTuple2["char3"] == 'c');
2254 assertTrue (aTuple2.length == 25);
2255
2256 assertTrue (aTuple != aTuple2);
2257 aTuple = aTuple2;
2258 assertTrue (aTuple == aTuple2);
2259 aTuple2.get<1>()++;
2260 assertTrue (aTuple < aTuple2);
2261
2262 TupleType aTuple3(aTuple2.names());
2263 assertTrue (aTuple3.names() == aTuple2.names());
2264 assertTrue (aTuple3["string1"] == "");
2265 assertTrue (aTuple3["int1"] == 0);
2266 assertTrue (aTuple3["bool1"] == false);
2267 assertTrue (aTuple3["char1"] == 0);
2268 assertTrue (aTuple3["long1"] == 0);
2269 assertTrue (aTuple3["short1"] == 0);
2270 assertTrue (aTuple3["string2"] == "");
2271 assertTrue (aTuple3["int2"] == 0);
2272 assertTrue (aTuple3["string3"] == "");
2273 assertTrue (aTuple3["int3"] == 0);
2274 assertTrue (aTuple3["bool2"] == false);
2275 assertTrue (aTuple3["char2"] == 0);
2276 assertTrue (aTuple3["long2"] == 0);
2277 assertTrue (aTuple3["short2"] == 0);
2278 assertTrue (aTuple3["string4"] == "");
2279 assertTrue (aTuple3["int4"] == 0);
2280 assertTrue (aTuple3["string5"] == "");
2281 assertTrue (aTuple3["int5"] == 0);
2282 assertTrue (aTuple3.length == 25);
2283
2284 assertTrue (aTuple.getName(0) == "string1");
2285 aTuple.setName(0, "New Name");
2286 assertTrue (aTuple.getName(0) == "New Name");
2287
2288 try { aTuple.setName(30, ""); fail("must fail"); }
2289 catch (InvalidArgumentException&) { }
2290}
2291
2292
2293void NamedTuplesTest::testNamedTuple26()
2294{
2295 typedef NamedTuple<std::string, // 0,A
2296 int, // 1, B
2297 bool, // 2, C
2298 float, // 3, D
2299 char, // 4, E
2300 long, // 5, F
2301 double, // 6, G
2302 short, // 7, H
2303 std::string, // 8, I
2304 int, // 9, J
2305 std::string, // 10, K
2306 int, // 11, L
2307 bool, // 12, M
2308 float, // 13, N
2309 char, // 14, O
2310 long, // 15, P
2311 double, // 16, Q
2312 short, // 17, R
2313 std::string, // 18, S
2314 int, // 19, T
2315 std::string, //20, U
2316 int, // 21, V
2317 bool, // 22, W
2318 float, //23, X
2319 char, // 24, Y
2320 long // 25, Z
2321 > TupleType;
2322
2323 TupleType aTuple;
2324
2325 assertTrue (aTuple["A"] == "");
2326 assertTrue (aTuple["B"] == 0);
2327 assertTrue (aTuple["C"] == false);
2328 assertTrue (aTuple["E"] == 0);
2329 assertTrue (aTuple["F"] == 0);
2330 assertTrue (aTuple["H"] == 0);
2331 assertTrue (aTuple["I"] == "");
2332 assertTrue (aTuple["J"] == 0);
2333 assertTrue (aTuple["K"] == "");
2334 assertTrue (aTuple["L"] == 0);
2335 assertTrue (aTuple["M"] == false);
2336 assertTrue (aTuple["O"] == 0);
2337 assertTrue (aTuple["P"] == 0);
2338 assertTrue (aTuple["R"] == 0);
2339 assertTrue (aTuple["S"] == "");
2340 assertTrue (aTuple["T"] == 0);
2341 assertTrue (aTuple["U"] == "");
2342 assertTrue (aTuple["V"] == 0);
2343 assertTrue (aTuple["W"] == false);
2344 assertTrue (aTuple["Y"] == 0);
2345 assertTrue (aTuple["Z"] == 0);
2346
2347 try { int POCO_UNUSED xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
2348 catch (NotFoundException&) { }
2349 assertTrue (aTuple.length == 26);
2350
2351 TupleType aTuple2("string1", "1",
2352 "int1", 1,
2353 "bool1", true,
2354 "float1", 1.5f,
2355 "char1", 'c',
2356 "long1", 999,
2357 "double1", 1.5,
2358 "short1", 32700,
2359 "string2", "2",
2360 "int2", 2,
2361 "string3", "3",
2362 "int3", 3,
2363 "bool2", true,
2364 "float2", 2.5,
2365 "char2", 'c',
2366 "long2", 999,
2367 "double2", 2.5,
2368 "short2", 32700,
2369 "string4", "4",
2370 "int4", 4,
2371 "string5", "5",
2372 "int5", 5,
2373 "bool3", true,
2374 "float3", 3.5f,
2375 "char3", 'c');
2376 assertTrue (aTuple2["string1"] == "1");
2377 assertTrue (aTuple2["int1"] == 1);
2378 assertTrue (aTuple2["bool1"] == true);
2379 assertTrue (aTuple2["float1"] == 1.5);
2380 assertTrue (aTuple2["char1"] == 'c');
2381 assertTrue (aTuple2["long1"] == 999);
2382 assertTrue (aTuple2["double1"] == 1.5);
2383 assertTrue (aTuple2["short1"] == 32700);
2384 assertTrue (aTuple2["string2"] == "2");
2385 assertTrue (aTuple2["int2"] == 2);
2386 assertTrue (aTuple2["string3"] == "3");
2387 assertTrue (aTuple2["int3"] == 3);
2388 assertTrue (aTuple2["bool2"] == true);
2389 assertTrue (aTuple2["float2"] == 2.5);
2390 assertTrue (aTuple2["char2"] == 'c');
2391 assertTrue (aTuple2["long2"] == 999);
2392 assertTrue (aTuple2["float2"] == 2.5);
2393 assertTrue (aTuple2["short2"] == 32700);
2394 assertTrue (aTuple2["string4"] == "4");
2395 assertTrue (aTuple2["int4"] == 4);
2396 assertTrue (aTuple2["string5"] == "5");
2397 assertTrue (aTuple2["int5"] == 5);
2398 assertTrue (aTuple2["bool3"] == true);
2399 assertTrue (aTuple2["float3"] == 3.5);
2400 assertTrue (aTuple2["char3"] == 'c');
2401 assertTrue (aTuple2.length == 26);
2402
2403 assertTrue (aTuple != aTuple2);
2404 aTuple = aTuple2;
2405 assertTrue (aTuple == aTuple2);
2406 aTuple2.get<1>()++;
2407 assertTrue (aTuple < aTuple2);
2408
2409 TupleType aTuple3(aTuple2.names());
2410 assertTrue (aTuple3.names() == aTuple2.names());
2411 assertTrue (aTuple3["string1"] == "");
2412 assertTrue (aTuple3["int1"] == 0);
2413 assertTrue (aTuple3["bool1"] == false);
2414 assertTrue (aTuple3["char1"] == 0);
2415 assertTrue (aTuple3["long1"] == 0);
2416 assertTrue (aTuple3["short1"] == 0);
2417 assertTrue (aTuple3["string2"] == "");
2418 assertTrue (aTuple3["int2"] == 0);
2419 assertTrue (aTuple3["string3"] == "");
2420 assertTrue (aTuple3["int3"] == 0);
2421 assertTrue (aTuple3["bool2"] == false);
2422 assertTrue (aTuple3["char2"] == 0);
2423 assertTrue (aTuple3["long2"] == 0);
2424 assertTrue (aTuple3["short2"] == 0);
2425 assertTrue (aTuple3["string4"] == "");
2426 assertTrue (aTuple3["int4"] == 0);
2427 assertTrue (aTuple3["string5"] == "");
2428 assertTrue (aTuple3["int5"] == 0);
2429 assertTrue (aTuple3.length == 26);
2430
2431 assertTrue (aTuple.getName(0) == "string1");
2432 aTuple.setName(0, "New Name");
2433 assertTrue (aTuple.getName(0) == "New Name");
2434
2435 try { aTuple.setName(30, ""); fail("must fail"); }
2436 catch (InvalidArgumentException&) { }
2437}
2438
2439
2440void NamedTuplesTest::testNamedTuple27()
2441{
2442 typedef NamedTuple<std::string, // 0,A
2443 int, // 1, B
2444 bool, // 2, C
2445 float, // 3, D
2446 char, // 4, E
2447 long, // 5, F
2448 double, // 6, G
2449 short, // 7, H
2450 std::string, // 8, I
2451 int, // 9, J
2452 std::string, // 10, K
2453 int, // 11, L
2454 bool, // 12, M
2455 float, // 13, N
2456 char, // 14, O
2457 long, // 15, P
2458 double, // 16, Q
2459 short, // 17, R
2460 std::string, // 18, S
2461 int, // 19, T
2462 std::string, //20, U
2463 int, // 21, V
2464 bool, // 22, W
2465 float, //23, X
2466 char, // 24, Y
2467 long, // 25, Z
2468 double // 26, A1
2469 > TupleType;
2470
2471 TupleType aTuple;
2472
2473 assertTrue (aTuple["A"] == "");
2474 assertTrue (aTuple["B"] == 0);
2475 assertTrue (aTuple["C"] == false);
2476 assertTrue (aTuple["E"] == 0);
2477 assertTrue (aTuple["F"] == 0);
2478 assertTrue (aTuple["H"] == 0);
2479 assertTrue (aTuple["I"] == "");
2480 assertTrue (aTuple["J"] == 0);
2481 assertTrue (aTuple["K"] == "");
2482 assertTrue (aTuple["L"] == 0);
2483 assertTrue (aTuple["M"] == false);
2484 assertTrue (aTuple["O"] == 0);
2485 assertTrue (aTuple["P"] == 0);
2486 assertTrue (aTuple["R"] == 0);
2487 assertTrue (aTuple["S"] == "");
2488 assertTrue (aTuple["T"] == 0);
2489 assertTrue (aTuple["U"] == "");
2490 assertTrue (aTuple["V"] == 0);
2491 assertTrue (aTuple["W"] == false);
2492 assertTrue (aTuple["X"] == 0);
2493 assertTrue (aTuple["Y"] == 0);
2494 assertTrue (aTuple["Z"] == 0);
2495
2496 try { int POCO_UNUSED xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
2497 catch (NotFoundException&) { }
2498 assertTrue (aTuple.length == 27);
2499
2500 TupleType aTuple2("string1", "1",
2501 "int1", 1,
2502 "bool1", true,
2503 "float1", 1.5f,
2504 "char1", 'c',
2505 "long1", 999,
2506 "double1", 1.5,
2507 "short1", 32700,
2508 "string2", "2",
2509 "int2", 2,
2510 "string3", "3",
2511 "int3", 3,
2512 "bool2", true,
2513 "float2", 2.5,
2514 "char2", 'c',
2515 "long2", 999,
2516 "double2", 2.5,
2517 "short2", 32700,
2518 "string4", "4",
2519 "int4", 4,
2520 "string5", "5",
2521 "int5", 5,
2522 "bool3", true,
2523 "float3", 3.5f,
2524 "char3", 'c',
2525 "long3", 999,
2526 "double3", 3.5);
2527 assertTrue (aTuple2["string1"] == "1");
2528 assertTrue (aTuple2["int1"] == 1);
2529 assertTrue (aTuple2["bool1"] == true);
2530 assertTrue (aTuple2["float1"] == 1.5);
2531 assertTrue (aTuple2["char1"] == 'c');
2532 assertTrue (aTuple2["long1"] == 999);
2533 assertTrue (aTuple2["double1"] == 1.5);
2534 assertTrue (aTuple2["short1"] == 32700);
2535 assertTrue (aTuple2["string2"] == "2");
2536 assertTrue (aTuple2["int2"] == 2);
2537 assertTrue (aTuple2["string3"] == "3");
2538 assertTrue (aTuple2["int3"] == 3);
2539 assertTrue (aTuple2["bool2"] == true);
2540 assertTrue (aTuple2["float2"] == 2.5);
2541 assertTrue (aTuple2["char2"] == 'c');
2542 assertTrue (aTuple2["long2"] == 999);
2543 assertTrue (aTuple2["float2"] == 2.5);
2544 assertTrue (aTuple2["short2"] == 32700);
2545 assertTrue (aTuple2["string4"] == "4");
2546 assertTrue (aTuple2["int4"] == 4);
2547 assertTrue (aTuple2["string5"] == "5");
2548 assertTrue (aTuple2["int5"] == 5);
2549 assertTrue (aTuple2["bool3"] == true);
2550 assertTrue (aTuple2["float3"] == 3.5);
2551 assertTrue (aTuple2["char3"] == 'c');
2552 assertTrue (aTuple2["long3"] == 999);
2553 assertTrue (aTuple2["double3"] == 3.5);
2554 assertTrue (aTuple2.length == 27);
2555
2556 assertTrue (aTuple != aTuple2);
2557 aTuple = aTuple2;
2558 assertTrue (aTuple == aTuple2);
2559 aTuple2.get<1>()++;
2560 assertTrue (aTuple < aTuple2);
2561
2562 TupleType aTuple3(aTuple2.names());
2563 assertTrue (aTuple3.names() == aTuple2.names());
2564 assertTrue (aTuple3["string1"] == "");
2565 assertTrue (aTuple3["int1"] == 0);
2566 assertTrue (aTuple3["bool1"] == false);
2567 assertTrue (aTuple3["char1"] == 0);
2568 assertTrue (aTuple3["long1"] == 0);
2569 assertTrue (aTuple3["short1"] == 0);
2570 assertTrue (aTuple3["string2"] == "");
2571 assertTrue (aTuple3["int2"] == 0);
2572 assertTrue (aTuple3["string3"] == "");
2573 assertTrue (aTuple3["int3"] == 0);
2574 assertTrue (aTuple3["bool2"] == false);
2575 assertTrue (aTuple3["char2"] == 0);
2576 assertTrue (aTuple3["long2"] == 0);
2577 assertTrue (aTuple3["short2"] == 0);
2578 assertTrue (aTuple3["string4"] == "");
2579 assertTrue (aTuple3["int4"] == 0);
2580 assertTrue (aTuple3["string5"] == "");
2581 assertTrue (aTuple3["int5"] == 0);
2582 assertTrue (aTuple3.length == 27);
2583
2584 assertTrue (aTuple.getName(0) == "string1");
2585 aTuple.setName(0, "New Name");
2586 assertTrue (aTuple.getName(0) == "New Name");
2587
2588 try { aTuple.setName(30, ""); fail("must fail"); }
2589 catch (InvalidArgumentException&) { }
2590}
2591
2592
2593void NamedTuplesTest::testNamedTuple28()
2594{
2595 typedef NamedTuple<std::string, // 0,A
2596 int, // 1, B
2597 bool, // 2, C
2598 float, // 3, D
2599 char, // 4, E
2600 long, // 5, F
2601 double, // 6, G
2602 short, // 7, H
2603 std::string, // 8, I
2604 int, // 9, J
2605 std::string, // 10, K
2606 int, // 11, L
2607 bool, // 12, M
2608 float, // 13, N
2609 char, // 14, O
2610 long, // 15, P
2611 double, // 16, Q
2612 short, // 17, R
2613 std::string, // 18, S
2614 int, // 19, T
2615 std::string, //20, U
2616 int, // 21, V
2617 bool, // 22, W
2618 float, //23, X
2619 char, // 24, Y
2620 long, // 25, Z
2621 double, // 26, A1
2622 short // 27, B1
2623 > TupleType;
2624
2625 TupleType aTuple;
2626
2627 assertTrue (aTuple["A"] == "");
2628 assertTrue (aTuple["B"] == 0);
2629 assertTrue (aTuple["C"] == false);
2630 assertTrue (aTuple["E"] == 0);
2631 assertTrue (aTuple["F"] == 0);
2632 assertTrue (aTuple["H"] == 0);
2633 assertTrue (aTuple["I"] == "");
2634 assertTrue (aTuple["J"] == 0);
2635 assertTrue (aTuple["K"] == "");
2636 assertTrue (aTuple["L"] == 0);
2637 assertTrue (aTuple["M"] == false);
2638 assertTrue (aTuple["O"] == 0);
2639 assertTrue (aTuple["P"] == 0);
2640 assertTrue (aTuple["R"] == 0);
2641 assertTrue (aTuple["S"] == "");
2642 assertTrue (aTuple["T"] == 0);
2643 assertTrue (aTuple["U"] == "");
2644 assertTrue (aTuple["V"] == 0);
2645 assertTrue (aTuple["W"] == false);
2646 assertTrue (aTuple["X"] == 0);
2647 assertTrue (aTuple["Y"] == 0);
2648 assertTrue (aTuple["Z"] == 0);
2649 assertTrue (aTuple["B1"] == 0);
2650
2651 try { int POCO_UNUSED xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
2652 catch (NotFoundException&) { }
2653 assertTrue (aTuple.length == 28);
2654
2655 TupleType aTuple2("string1", "1",
2656 "int1", 1,
2657 "bool1", true,
2658 "float1", 1.5f,
2659 "char1", 'c',
2660 "long1", 999,
2661 "double1", 1.5,
2662 "short1", 32700,
2663 "string2", "2",
2664 "int2", 2,
2665 "string3", "3",
2666 "int3", 3,
2667 "bool2", true,
2668 "float2", 2.5,
2669 "char2", 'c',
2670 "long2", 999,
2671 "double2", 2.5,
2672 "short2", 32700,
2673 "string4", "4",
2674 "int4", 4,
2675 "string5", "5",
2676 "int5", 5,
2677 "bool3", true,
2678 "float3", 3.5f,
2679 "char3", 'c',
2680 "long3", 999,
2681 "double3", 3.5,
2682 "short3", 3);
2683 assertTrue (aTuple2["string1"] == "1");
2684 assertTrue (aTuple2["int1"] == 1);
2685 assertTrue (aTuple2["bool1"] == true);
2686 assertTrue (aTuple2["float1"] == 1.5);
2687 assertTrue (aTuple2["char1"] == 'c');
2688 assertTrue (aTuple2["long1"] == 999);
2689 assertTrue (aTuple2["double1"] == 1.5);
2690 assertTrue (aTuple2["short1"] == 32700);
2691 assertTrue (aTuple2["string2"] == "2");
2692 assertTrue (aTuple2["int2"] == 2);
2693 assertTrue (aTuple2["string3"] == "3");
2694 assertTrue (aTuple2["int3"] == 3);
2695 assertTrue (aTuple2["bool2"] == true);
2696 assertTrue (aTuple2["float2"] == 2.5);
2697 assertTrue (aTuple2["char2"] == 'c');
2698 assertTrue (aTuple2["long2"] == 999);
2699 assertTrue (aTuple2["float2"] == 2.5);
2700 assertTrue (aTuple2["short2"] == 32700);
2701 assertTrue (aTuple2["string4"] == "4");
2702 assertTrue (aTuple2["int4"] == 4);
2703 assertTrue (aTuple2["string5"] == "5");
2704 assertTrue (aTuple2["int5"] == 5);
2705 assertTrue (aTuple2["bool3"] == true);
2706 assertTrue (aTuple2["float3"] == 3.5);
2707 assertTrue (aTuple2["char3"] == 'c');
2708 assertTrue (aTuple2["long3"] == 999);
2709 assertTrue (aTuple2["double3"] == 3.5);
2710 assertTrue (aTuple2["short3"] == 3);
2711 assertTrue (aTuple2.length == 28);
2712
2713 assertTrue (aTuple != aTuple2);
2714 aTuple = aTuple2;
2715 assertTrue (aTuple == aTuple2);
2716 aTuple2.get<1>()++;
2717 assertTrue (aTuple < aTuple2);
2718
2719 TupleType aTuple3(aTuple2.names());
2720 assertTrue (aTuple3.names() == aTuple2.names());
2721 assertTrue (aTuple3["string1"] == "");
2722 assertTrue (aTuple3["int1"] == 0);
2723 assertTrue (aTuple3["bool1"] == false);
2724 assertTrue (aTuple3["char1"] == 0);
2725 assertTrue (aTuple3["long1"] == 0);
2726 assertTrue (aTuple3["short1"] == 0);
2727 assertTrue (aTuple3["string2"] == "");
2728 assertTrue (aTuple3["int2"] == 0);
2729 assertTrue (aTuple3["string3"] == "");
2730 assertTrue (aTuple3["int3"] == 0);
2731 assertTrue (aTuple3["bool2"] == false);
2732 assertTrue (aTuple3["char2"] == 0);
2733 assertTrue (aTuple3["long2"] == 0);
2734 assertTrue (aTuple3["short2"] == 0);
2735 assertTrue (aTuple3["string4"] == "");
2736 assertTrue (aTuple3["int4"] == 0);
2737 assertTrue (aTuple3["string5"] == "");
2738 assertTrue (aTuple3["int5"] == 0);
2739 assertTrue (aTuple3.length == 28);
2740
2741 assertTrue (aTuple.getName(0) == "string1");
2742 aTuple.setName(0, "New Name");
2743 assertTrue (aTuple.getName(0) == "New Name");
2744
2745 try { aTuple.setName(30, ""); fail("must fail"); }
2746 catch (InvalidArgumentException&) { }
2747}
2748
2749
2750void NamedTuplesTest::testNamedTuple29()
2751{
2752 typedef NamedTuple<std::string, // A
2753 int, // B
2754 bool, // C
2755 float, // D
2756 char, // E
2757 long, // F
2758 double, // G
2759 short, // H
2760 std::string, // I
2761 int, // J
2762 std::string, // K
2763 int, // L
2764 bool, // M
2765 float, // N
2766 char, // O
2767 long, // P
2768 double, // Q
2769 short, // R
2770 std::string, // S
2771 int, // T
2772 std::string, // U
2773 int, // V
2774 bool, // W
2775 float, //X
2776 char, // Y
2777 long, // Z
2778 double, // A1
2779 short, // B1
2780 std::string // C1
2781 > TupleType;
2782
2783 TupleType aTuple;
2784
2785 assertTrue (aTuple["A"] == "");
2786 assertTrue (aTuple["B"] == 0);
2787 assertTrue (aTuple["C"] == false);
2788 assertTrue (aTuple["E"] == 0);
2789 assertTrue (aTuple["F"] == 0);
2790 assertTrue (aTuple["H"] == 0);
2791 assertTrue (aTuple["I"] == "");
2792 assertTrue (aTuple["J"] == 0);
2793 assertTrue (aTuple["K"] == "");
2794 assertTrue (aTuple["L"] == 0);
2795 assertTrue (aTuple["M"] == false);
2796 assertTrue (aTuple["O"] == 0);
2797 assertTrue (aTuple["P"] == 0);
2798 assertTrue (aTuple["R"] == 0);
2799 assertTrue (aTuple["S"] == "");
2800 assertTrue (aTuple["T"] == 0);
2801 assertTrue (aTuple["U"] == "");
2802 assertTrue (aTuple["V"] == 0);
2803 assertTrue (aTuple["W"] == false);
2804 assertTrue (aTuple["X"] == 0);
2805 assertTrue (aTuple["Y"] == 0);
2806 assertTrue (aTuple["Z"] == 0);
2807 assertTrue (aTuple["B1"] == 0);
2808 assertTrue (aTuple["C1"] == "");
2809
2810 try { int POCO_UNUSED xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
2811 catch (NotFoundException&) { }
2812 assertTrue (aTuple.length == 29);
2813
2814 TupleType aTuple2("string1", "1",
2815 "int1", 1,
2816 "bool1", true,
2817 "float1", 1.5f,
2818 "char1", 'c',
2819 "long1", 999,
2820 "double1", 1.5,
2821 "short1", 32700,
2822 "string2", "2",
2823 "int2", 2,
2824 "string3", "3",
2825 "int3", 3,
2826 "bool2", true,
2827 "float2", 2.5,
2828 "char2", 'c',
2829 "long2", 999,
2830 "double2", 2.5,
2831 "short2", 32700,
2832 "string4", "4",
2833 "int4", 4,
2834 "string5", "5",
2835 "int5", 5,
2836 "bool3", true,
2837 "float3", 3.5f,
2838 "char3", 'c',
2839 "long3", 999,
2840 "double3", 3.5,
2841 "short3", 32700,
2842 "string6", "6");
2843 assertTrue (aTuple2["string1"] == "1");
2844 assertTrue (aTuple2["int1"] == 1);
2845 assertTrue (aTuple2["bool1"] == true);
2846 assertTrue (aTuple2["float1"] == 1.5);
2847 assertTrue (aTuple2["char1"] == 'c');
2848 assertTrue (aTuple2["long1"] == 999);
2849 assertTrue (aTuple2["double1"] == 1.5);
2850 assertTrue (aTuple2["short1"] == 32700);
2851 assertTrue (aTuple2["string2"] == "2");
2852 assertTrue (aTuple2["int2"] == 2);
2853 assertTrue (aTuple2["string3"] == "3");
2854 assertTrue (aTuple2["int3"] == 3);
2855 assertTrue (aTuple2["bool2"] == true);
2856 assertTrue (aTuple2["float2"] == 2.5);
2857 assertTrue (aTuple2["char2"] == 'c');
2858 assertTrue (aTuple2["long2"] == 999);
2859 assertTrue (aTuple2["float2"] == 2.5);
2860 assertTrue (aTuple2["short2"] == 32700);
2861 assertTrue (aTuple2["string4"] == "4");
2862 assertTrue (aTuple2["int4"] == 4);
2863 assertTrue (aTuple2["string5"] == "5");
2864 assertTrue (aTuple2["int5"] == 5);
2865 assertTrue (aTuple2["bool3"] == true);
2866 assertTrue (aTuple2["float3"] == 3.5);
2867 assertTrue (aTuple2["char3"] == 'c');
2868 assertTrue (aTuple2["long3"] == 999);
2869 assertTrue (aTuple2["double3"] == 3.5);
2870 assertTrue (aTuple2["short3"] == 32700);
2871 assertTrue (aTuple2["string6"] == "6");
2872 assertTrue (aTuple2.length == 29);
2873
2874 assertTrue (aTuple != aTuple2);
2875
2876 aTuple = aTuple2;
2877 assertTrue (aTuple == aTuple2);
2878 aTuple2.get<1>()++;
2879 assertTrue (aTuple < aTuple2);
2880
2881 TupleType aTuple3(aTuple2.names());
2882 assertTrue (aTuple3.names() == aTuple2.names());
2883 assertTrue (aTuple3["string1"] == "");
2884 assertTrue (aTuple3["int1"] == 0);
2885 assertTrue (aTuple3["bool1"] == false);
2886 assertTrue (aTuple3["char1"] == 0);
2887 assertTrue (aTuple3["long1"] == 0);
2888 assertTrue (aTuple3["short1"] == 0);
2889 assertTrue (aTuple3["string2"] == "");
2890 assertTrue (aTuple3["int2"] == 0);
2891 assertTrue (aTuple3["string3"] == "");
2892 assertTrue (aTuple3["int3"] == 0);
2893 assertTrue (aTuple3["bool2"] == false);
2894 assertTrue (aTuple3["char2"] == 0);
2895 assertTrue (aTuple3["long2"] == 0);
2896 assertTrue (aTuple3["short2"] == 0);
2897 assertTrue (aTuple3["string4"] == "");
2898 assertTrue (aTuple3["int4"] == 0);
2899 assertTrue (aTuple3["string5"] == "");
2900 assertTrue (aTuple3["int5"] == 0);
2901 assertTrue (aTuple3["string6"] == "");
2902 assertTrue (aTuple3.length == 29);
2903
2904 assertTrue (aTuple.getName(0) == "string1");
2905 aTuple.setName(0, "New Name");
2906 assertTrue (aTuple.getName(0) == "New Name");
2907
2908 try { aTuple.setName(30, ""); fail("must fail"); }
2909 catch (InvalidArgumentException&) { }
2910}
2911
2912
2913void NamedTuplesTest::testNamedTuple30()
2914{
2915 typedef NamedTuple<std::string, // A
2916 int, // B
2917 bool, // C
2918 float, // D
2919 char, // E
2920 long, // F
2921 double, // G
2922 short, // H
2923 std::string, // I
2924 int, // J
2925 std::string, // K
2926 int, // L
2927 bool, // M
2928 float, // N
2929 char, // O
2930 long, // P
2931 double, // Q
2932 short, // R
2933 std::string, // S
2934 int, // T
2935 std::string, // U
2936 int, // V
2937 bool, // W
2938 float, //X
2939 char, // Y
2940 long, // Z
2941 double, // A1
2942 short, // B1
2943 std::string, // C1
2944 int // D1
2945 > TupleType;
2946
2947 TupleType aTuple;
2948
2949 assertTrue (aTuple["A"] == "");
2950 assertTrue (aTuple["B"] == 0);
2951 assertTrue (aTuple["C"] == false);
2952 assertTrue (aTuple["E"] == 0);
2953 assertTrue (aTuple["F"] == 0);
2954 assertTrue (aTuple["H"] == 0);
2955 assertTrue (aTuple["I"] == "");
2956 assertTrue (aTuple["J"] == 0);
2957 assertTrue (aTuple["K"] == "");
2958 assertTrue (aTuple["L"] == 0);
2959 assertTrue (aTuple["M"] == false);
2960 assertTrue (aTuple["O"] == 0);
2961 assertTrue (aTuple["P"] == 0);
2962 assertTrue (aTuple["R"] == 0);
2963 assertTrue (aTuple["S"] == "");
2964 assertTrue (aTuple["T"] == 0);
2965 assertTrue (aTuple["U"] == "");
2966 assertTrue (aTuple["V"] == 0);
2967 assertTrue (aTuple["W"] == false);
2968 assertTrue (aTuple["X"] == 0);
2969 assertTrue (aTuple["Y"] == 0);
2970 assertTrue (aTuple["Z"] == 0);
2971 assertTrue (aTuple["B1"] == 0);
2972 assertTrue (aTuple["C1"] == "");
2973 assertTrue (aTuple["D1"] == 0);
2974
2975 try { int POCO_UNUSED xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
2976 catch (NotFoundException&) { }
2977 assertTrue (aTuple.length == 30);
2978
2979 TupleType aTuple2("string1", "1",
2980 "int1", 1,
2981 "bool1", true,
2982 "float1", 1.5f,
2983 "char1", 'c',
2984 "long1", 999,
2985 "double1", 1.5,
2986 "short1", 32700,
2987 "string2", "2",
2988 "int2", 2,
2989 "string3", "3",
2990 "int3", 3,
2991 "bool2", true,
2992 "float2", 2.5,
2993 "char2", 'c',
2994 "long2", 999,
2995 "double2", 2.5,
2996 "short2", 32700,
2997 "string4", "4",
2998 "int4", 4,
2999 "string5", "5",
3000 "int5", 5,
3001 "bool3", true,
3002 "float3", 3.5f,
3003 "char3", 'c',
3004 "long3", 999,
3005 "double3", 3.5,
3006 "short3", 32700,
3007 "string6", "6",
3008 "int6", 6);
3009 assertTrue (aTuple2["string1"] == "1");
3010 assertTrue (aTuple2["int1"] == 1);
3011 assertTrue (aTuple2["bool1"] == true);
3012 assertTrue (aTuple2["float1"] == 1.5);
3013 assertTrue (aTuple2["char1"] == 'c');
3014 assertTrue (aTuple2["long1"] == 999);
3015 assertTrue (aTuple2["double1"] == 1.5);
3016 assertTrue (aTuple2["short1"] == 32700);
3017 assertTrue (aTuple2["string2"] == "2");
3018 assertTrue (aTuple2["int2"] == 2);
3019 assertTrue (aTuple2["string3"] == "3");
3020 assertTrue (aTuple2["int3"] == 3);
3021 assertTrue (aTuple2["bool2"] == true);
3022 assertTrue (aTuple2["float2"] == 2.5);
3023 assertTrue (aTuple2["char2"] == 'c');
3024 assertTrue (aTuple2["long2"] == 999);
3025 assertTrue (aTuple2["float2"] == 2.5);
3026 assertTrue (aTuple2["short2"] == 32700);
3027 assertTrue (aTuple2["string4"] == "4");
3028 assertTrue (aTuple2["int4"] == 4);
3029 assertTrue (aTuple2["string5"] == "5");
3030 assertTrue (aTuple2["int5"] == 5);
3031 assertTrue (aTuple2["bool3"] == true);
3032 assertTrue (aTuple2["float3"] == 3.5);
3033 assertTrue (aTuple2["char3"] == 'c');
3034 assertTrue (aTuple2["long3"] == 999);
3035 assertTrue (aTuple2["double3"] == 3.5);
3036 assertTrue (aTuple2["short3"] == 32700);
3037 assertTrue (aTuple2["string6"] == "6");
3038 assertTrue (aTuple2["int6"] == 6);
3039 assertTrue (aTuple2.length == 30);
3040
3041 assertTrue (aTuple != aTuple2);
3042
3043 aTuple = aTuple2;
3044 assertTrue (aTuple == aTuple2);
3045 aTuple2.get<1>()++;
3046 assertTrue (aTuple < aTuple2);
3047
3048 TupleType aTuple3(aTuple2.names());
3049 assertTrue (aTuple3.names() == aTuple2.names());
3050 assertTrue (aTuple3["string1"] == "");
3051 assertTrue (aTuple3["int1"] == 0);
3052 assertTrue (aTuple3["bool1"] == false);
3053 assertTrue (aTuple3["char1"] == 0);
3054 assertTrue (aTuple3["long1"] == 0);
3055 assertTrue (aTuple3["short1"] == 0);
3056 assertTrue (aTuple3["string2"] == "");
3057 assertTrue (aTuple3["int2"] == 0);
3058 assertTrue (aTuple3["string3"] == "");
3059 assertTrue (aTuple3["int3"] == 0);
3060 assertTrue (aTuple3["bool2"] == false);
3061 assertTrue (aTuple3["char2"] == 0);
3062 assertTrue (aTuple3["long2"] == 0);
3063 assertTrue (aTuple3["short2"] == 0);
3064 assertTrue (aTuple3["string4"] == "");
3065 assertTrue (aTuple3["int4"] == 0);
3066 assertTrue (aTuple3["string5"] == "");
3067 assertTrue (aTuple3["int5"] == 0);
3068 assertTrue (aTuple3["string6"] == "");
3069 assertTrue (aTuple3["int6"] == 0);
3070 assertTrue (aTuple3.length == 30);
3071
3072 assertTrue (aTuple.getName(0) == "string1");
3073 aTuple.setName(0, "New Name");
3074 assertTrue (aTuple.getName(0) == "New Name");
3075
3076 try { aTuple.setName(30, ""); fail("must fail"); }
3077 catch (InvalidArgumentException&) { }
3078}
3079
3080
3081void NamedTuplesTest::setUp()
3082{
3083}
3084
3085
3086void NamedTuplesTest::tearDown()
3087{
3088}
3089
3090
3091CppUnit::Test* NamedTuplesTest::suite()
3092{
3093 CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("NamedTuplesTest");
3094
3095 CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple1);
3096 CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple2);
3097 CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple3);
3098 CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple4);
3099 CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple5);
3100 CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple6);
3101 CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple7);
3102 CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple8);
3103 CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple9);
3104 CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple10);
3105 CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple11);
3106 CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple12);
3107 CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple13);
3108 CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple14);
3109 CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple15);
3110 CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple16);
3111 CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple17);
3112 CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple18);
3113 CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple19);
3114 CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple20);
3115 CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple21);
3116 CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple22);
3117 CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple23);
3118 CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple24);
3119 CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple25);
3120 CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple26);
3121 CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple27);
3122 CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple28);
3123 CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple29);
3124 CppUnit_addTest(pSuite, NamedTuplesTest, testNamedTuple30);
3125
3126 return pSuite;
3127}
3128