-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainPraktikum.cpp
692 lines (644 loc) · 19.5 KB
/
mainPraktikum.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
/*!******************************************************//**
* Unit-Tests fürs Praktikum (UTF-8) *
***********************************************************/
// Der Test auf Sonderzeichen ist vom Zeichensatz abhängig, bisher Cp1252, hier aber UTF-8.
//
// Bitte hier eintragen, welcher Teil bearbeitet wird,
// TEIL_1 = Array-Implementierung (CArray)
// TEIL_2 = Trie-Implementierung (CTrie)
#define TEIL_1
// Benötigte Bibliotheken einbinden
#include <iostream>
#include <vector>
#include <string>
#include <map>
// Google Test einbinden
#include "gtest/gtest.h"
// Vorgegebene Klassen einbinden
#include "CLZW.hpp"
#include "CEnc.hpp"
#include "CDec.hpp"
// Praktikumsklassen einbinden
#include "CEntry.hpp"
#include "CArray.hpp"
#include "XOutOfBounds.hpp"
#include "CKnot.hpp"
#include "CDoubleHashing.hpp"
#include "CCounter.hpp"
#include "CForwardCounter.hpp"
#include "CArrayEnc.hpp"
#include "CArrayDec.hpp"
#ifdef TEIL_2
#include "CTrieEnc.hpp"
#include "CTrieDec.hpp"
#endif
using namespace std;
// Maps mit Zuordnung von Strings zu Ausgabewerten für den Test der Komprimierung
map<string, vector<unsigned int> > testPhrasesList;
map<string, vector<unsigned int> > testPhrasesTrie;
// Initialwert des CForwardCounter testen (Aufgaben 2 und 3)
TEST(CForwardCounterTest, InitialZero) {
CForwardCounter counter;
EXPECT_EQ(0, counter.getValue()) << "Vorwaertszaehler ist nach Erstellung nicht 0!";
}
// Zählen des CForwardCounter testen (Aufgaben 2 und 3)
TEST(CForwardCounterTest, Counting) {
CForwardCounter counter;
int value = counter.getValue() + 1;
counter.count();
EXPECT_EQ(value, counter.getValue()) << "Zaehlerwert wird bei count() nicht um 1 erhoeht!";
}
// Testen ob CEntry ordentlich initialisiert wird (Aufgabe 5)
TEST(CEntryTest, InitialEmpty) {
CEntry entry;
EXPECT_EQ("", entry.getSymbol()) << "Symbol ist initial nicht leer!";
}
// Testen ob das Symbol in CEntry gesetzt werden kann (Aufgabe 5)
TEST(CEntryTest, SetSymbol) {
CEntry entry;
string str = "TEST";
entry.setSymbol(str);
EXPECT_EQ(str, entry.getSymbol()) << "Symbol kann nicht gesetzt werden!";
}
// Testen ob die Anzahl der CEntry-Instanzen richtig gezählt wird (Aufgabe 5)
TEST(CEntryTest, CountInstances) {
unsigned int zero = 0;
EXPECT_EQ(zero, CEntry::getNumber());
CEntry* entries[10];
for (unsigned int i = 0; i < 10; i++) {
entries[i] = new CEntry;
EXPECT_EQ(i+1, CEntry::getNumber());
}
for (unsigned int i = 0; i < 10; i++) {
delete entries[i];
EXPECT_EQ(9-i, CEntry::getNumber());
}
}
// Test ob Zugriff auf Arrayelemente in CArray funktioniert (Aufgabe 6)
TEST(CArrayTest, Array) {
CArray<unsigned int, 10> dict;
for (unsigned int i = 0; i < 10; i++) {
dict[i] = i;
}
for (unsigned int i = 0; i < 10; i++) {
EXPECT_EQ(i, dict[i]);
}
}
// Test ob Exception bei Bereichsüberschreitung in CArray wirklich geworfen wird (Aufgabe 6)
TEST(CArrayTest, Exception) {
CArray<int, 10> dict;
EXPECT_THROW(dict[10], XOutOfBounds) << "Exception wird bei zu grossem Index nicht geworfen!";
}
// Test der Methoden für Attribut symbol in CKnot (Aufgabe 6)
TEST(CKnotTest, symbol) {
CKnot knot;
EXPECT_EQ("", knot.getSymbol()) << "symbol ist initial nicht leer!";
knot.setSymbol("Unit-Test");
EXPECT_EQ("Unit-Test", knot.getSymbol()) << "symbol kann nicht gesetzt werden!";
}
// Test der Methoden für Attribut parent in CKnot (Aufgabe 6)
TEST(CKnotTest, parent) {
CKnot knot;
EXPECT_EQ(-2, knot.getParent()) << "parent ist initial nicht -2!";
knot.setParent(6);
EXPECT_EQ(6, knot.getParent()) << "parent kann nicht gesetzt werden!";
}
// Test der ersten Hashingfunktion in CDoubleHashing (Aufgabe 7)
TEST(CDoubleHashingTest, SimpleHashing) {
CDoubleHashing& hash = CDoubleHashing::getInstance();
EXPECT_EQ(4, int(hash.hash(3, 4, 7, 0)));
EXPECT_EQ(1, int(hash.hash(1, 2, 7, 0)));
EXPECT_EQ(0, int(hash.hash(2, 1, 7, 0)));
}
// Test des doppelten Hashing in CDoubleHashing (Aufgabe 7)
TEST(CDoubleHashingTest, DoubleHashing) {
CDoubleHashing& hash = CDoubleHashing::getInstance();
EXPECT_EQ(10, int(hash.hash(3, 4, 11, 0)));
EXPECT_EQ(5, int(hash.hash(3, 4, 11, 1)));
EXPECT_EQ(0, int(hash.hash(3, 4, 11, 2)));
EXPECT_EQ(6, int(hash.hash(3, 4, 11, 3)));
}
#ifdef TEIL_1
// LZW-Listenimplementierung getrennt nach Encoder und Decoder mit allen Testphrasen testen
TEST(CLZWListTest, Encoder) {
// über alle Teststring iterieren
for (map<string, vector<unsigned int> >::iterator it = testPhrasesList.begin(); it != testPhrasesList.end(); it++) {
// Instanz muss immer neu angelegt werden, da sonst die Tabelle noch alte Einträge enthält
CArrayEnc* lzw_enc = new CArrayEnc;
// Phrase testen
string input = it->first;
vector<unsigned int> encoded = lzw_enc->encode(input);
vector<unsigned int> reference = it->second;
EXPECT_EQ(reference, encoded) << "Liste: Encodierung des Strings \"" << it->first << "\" ist fehlerhaft.";
// und Instanz wieder löschen
delete lzw_enc;
}
}
TEST(CLZWListTest, Decoder) {
// über alle Teststring iterieren
for (map<string, vector<unsigned int> >::iterator it = testPhrasesList.begin(); it != testPhrasesList.end(); it++) {
// Instanz muss immer neu angelegt werden, da sonst die Tabelle noch alte Einträge enthält
CArrayDec* lzw_dec = new CArrayDec;
// Phrase testen
vector<unsigned int> input = it->second;
string reference = it->first;
string decoded = lzw_dec->decode(input);
EXPECT_EQ(reference, decoded) << "Liste: Decodierung der Indizes \"" << it->first << "\" ist fehlerhaft.";
// und Instanz wieder löschen
delete lzw_dec;
}
}
#endif // Ende Listenversion Encoder und Decoder
#ifdef TEIL_2
// LZW Trie-Implementierung getrennt nach Encoder und Decoder mit allen Testphrasen testen
// Zur Zeit wird nur der Encoder im Praktikum verlangt, später ggf. den Decodertest einkommentieren.
TEST(CTrieTest, Encoder) {
// über alle Teststring iterieren
for (map<string, vector<unsigned int> >::iterator it = testPhrasesTrie.begin(); it != testPhrasesTrie.end(); it++) {
// Instanz muss immer neu angelegt werden, da sonst die Tabelle noch alte Einträge enthält
CTrieEnc* lzw_enc = new CTrieEnc;
// Phrase testen
string input = it->first;
vector<unsigned int> encoded = lzw_enc->encode(input);
vector<unsigned int> reference = it->second;
EXPECT_EQ(reference, encoded) << "Trie: Encodierung des Strings \"" << it->first << "\" ist fehlerhaft.";
// und Instanz wieder löschen
delete lzw_enc;
}
}
TEST(CTrieTest, Decoder) {
// über alle Teststrings iterieren
for (map<string, vector<unsigned int>>::iterator it = testPhrasesTrie.begin(); it != testPhrasesTrie.end(); it++) {
// Instanz muss immer neu angelegt werden, da sonst die Tabelle noch alte Einträge enthält
CTrieDec* lzw_dec = new CTrieDec;
// Phrase testen
vector<unsigned int> input = it->second;
string reference = it->first;
string decoded = lzw_dec->decode(input);
EXPECT_EQ(reference, decoded) << "Trie: Decodierung des Strings \"" << it->first << "\" ist fehlerhaft.";
// und Instanz wieder löschen
delete lzw_dec;
}
}
#endif // Ende Trie Encoder und Decoder
// Map mit den Testphrasen und Ergebnissen aufbauen
void buildPhrases() {
vector<unsigned int> resultList;
vector<unsigned int> resultTrie;
// Test auf leere Liste
resultList.clear();
resultTrie.clear();
// Hier entsteht die für Test verwendete Datenstruktur
testPhrasesList[""] = resultList;
testPhrasesTrie[""] = resultTrie;
// Test auf periodische Paare
resultList.clear();
resultList.push_back(120);
resultList.push_back(121);
resultList.push_back(256);
resultList.push_back(258);
resultList.push_back(257);
resultList.push_back(260);
resultList.push_back(259);
resultTrie.clear();
resultTrie.push_back(120);
resultTrie.push_back(121);
resultTrie.push_back(1282);
resultTrie.push_back(1623);
resultTrie.push_back(1281);
resultTrie.push_back(1624);
resultTrie.push_back(1761);
// Hier entsteht die für Test verwendete Datenstruktur
testPhrasesList["xyxyxyxyxyxyxyxy"] = resultList;
testPhrasesTrie["xyxyxyxyxyxyxyxy"] = resultTrie;
// Test auf Wiederholung eines Zeichens
resultList.clear();
resultList.push_back(99);
resultList.push_back(256);
resultList.push_back(257);
resultList.push_back(258);
resultList.push_back(259);
resultList.push_back(259);
resultTrie.clear();
resultTrie.push_back(99);
resultTrie.push_back(1800);
resultTrie.push_back(1965);
resultTrie.push_back(1179);
resultTrie.push_back(1380);
resultTrie.push_back(1380);
// Hier entsteht die für Test verwendete Datenstruktur
testPhrasesList["cccccccccccccccccccc"] = resultList;
testPhrasesTrie["cccccccccccccccccccc"] = resultTrie;
// Test auf Umlaute und Sonderzeichen
resultList.clear();
// Cp1252
/*resultList.push_back(228);
resultList.push_back(246);
resultList.push_back(252);
resultList.push_back(196);
resultList.push_back(214);
resultList.push_back(220);
resultList.push_back(223);
resultList.push_back(33);
resultList.push_back(167);
resultList.push_back(36);
resultList.push_back(37);
resultList.push_back(38);
resultList.push_back(47);
resultList.push_back(40);
resultList.push_back(41);
resultList.push_back(61);
resultList.push_back(63);
resultList.push_back(123);
resultList.push_back(91);
resultList.push_back(93);
resultList.push_back(125);
resultList.push_back(92);
resultList.push_back(180);
resultList.push_back(96);
resultList.push_back(43);
resultList.push_back(42);
resultList.push_back(126);
resultList.push_back(35);
resultList.push_back(39);
resultList.push_back(45);
resultList.push_back(95);
resultList.push_back(46);
resultList.push_back(58);
resultList.push_back(44);
resultList.push_back(59);
resultList.push_back(60);
resultList.push_back(62);
resultList.push_back(124);
*/
// UTF-8
resultList.push_back(195);
resultList.push_back(164);
resultList.push_back(195);
resultList.push_back(182);
resultList.push_back(195);
resultList.push_back(188);
resultList.push_back(195);
resultList.push_back(132);
resultList.push_back(195);
resultList.push_back(150);
resultList.push_back(195);
resultList.push_back(156);
resultList.push_back(195);
resultList.push_back(159);
resultList.push_back(33);
resultList.push_back(194);
resultList.push_back(167);
resultList.push_back(36);
resultList.push_back(37);
resultList.push_back(38);
resultList.push_back(47);
resultList.push_back(40);
resultList.push_back(41);
resultList.push_back(61);
resultList.push_back(63);
resultList.push_back(123);
resultList.push_back(91);
resultList.push_back(93);
resultList.push_back(125);
resultList.push_back(92);
resultList.push_back(194);
resultList.push_back(180);
resultList.push_back(96);
resultList.push_back(43);
resultList.push_back(42);
resultList.push_back(126);
resultList.push_back(35);
resultList.push_back(39);
resultList.push_back(45);
resultList.push_back(95);
resultList.push_back(46);
resultList.push_back(58);
resultList.push_back(44);
resultList.push_back(59);
resultList.push_back(60);
resultList.push_back(62);
resultList.push_back(124);
resultTrie.clear();
// Cp1252
/*
resultTrie.push_back(228);
resultTrie.push_back(246);
resultTrie.push_back(252);
resultTrie.push_back(196);
resultTrie.push_back(214);
resultTrie.push_back(220);
resultTrie.push_back(223);
resultTrie.push_back(33);
resultTrie.push_back(167);
resultTrie.push_back(36);
resultTrie.push_back(37);
resultTrie.push_back(38);
resultTrie.push_back(47);
resultTrie.push_back(40);
resultTrie.push_back(41);
resultTrie.push_back(61);
resultTrie.push_back(63);
resultTrie.push_back(123);
resultTrie.push_back(91);
resultTrie.push_back(93);
resultTrie.push_back(125);
resultTrie.push_back(92);
resultTrie.push_back(180);
resultTrie.push_back(96);
resultTrie.push_back(43);
resultTrie.push_back(42);
resultTrie.push_back(126);
resultTrie.push_back(35);
resultTrie.push_back(39);
resultTrie.push_back(45);
resultTrie.push_back(95);
resultTrie.push_back(46);
resultTrie.push_back(58);
resultTrie.push_back(44);
resultTrie.push_back(59);
resultTrie.push_back(60);
resultTrie.push_back(62);
resultTrie.push_back(124);
*/
// UTF-8
// UTF-8
resultTrie.push_back(195);
resultTrie.push_back(164);
resultTrie.push_back(195);
resultTrie.push_back(182);
resultTrie.push_back(195);
resultTrie.push_back(188);
resultTrie.push_back(195);
resultTrie.push_back(132);
resultTrie.push_back(195);
resultTrie.push_back(150);
resultTrie.push_back(195);
resultTrie.push_back(156);
resultTrie.push_back(195);
resultTrie.push_back(159);
resultTrie.push_back(33);
resultTrie.push_back(194);
resultTrie.push_back(167);
resultTrie.push_back(36);
resultTrie.push_back(37);
resultTrie.push_back(38);
resultTrie.push_back(47);
resultTrie.push_back(40);
resultTrie.push_back(41);
resultTrie.push_back(61);
resultTrie.push_back(63);
resultTrie.push_back(123);
resultTrie.push_back(91);
resultTrie.push_back(93);
resultTrie.push_back(125);
resultTrie.push_back(92);
resultTrie.push_back(194);
resultTrie.push_back(180);
resultTrie.push_back(96);
resultTrie.push_back(43);
resultTrie.push_back(42);
resultTrie.push_back(126);
resultTrie.push_back(35);
resultTrie.push_back(39);
resultTrie.push_back(45);
resultTrie.push_back(95);
resultTrie.push_back(46);
resultTrie.push_back(58);
resultTrie.push_back(44);
resultTrie.push_back(59);
resultTrie.push_back(60);
resultTrie.push_back(62);
resultTrie.push_back(124);
// Hier entsteht die für Test verwendete Datenstruktur
// Der Backslash 92 \ muss im String doppelt erscheinen, sonst wäre es ein Steuerzeichen.
testPhrasesList["äöüÄÖÜß!§$%&/()=?{[]}\\""´`+*~#'-_.:,;<>|"] = resultList;
testPhrasesTrie["äöüÄÖÜß!§$%&/()=?{[]}\\""´`+*~#'-_.:,;<>|"] = resultTrie;
// Test auf allgemeinen Text
resultList.clear();
resultList.push_back(87);
resultList.push_back(101);
resultList.push_back(110);
resultList.push_back(110);
resultList.push_back(32);
resultList.push_back(83);
resultList.push_back(111);
resultList.push_back(110);
resultList.push_back(100);
resultList.push_back(101);
resultList.push_back(114);
resultList.push_back(122);
resultList.push_back(101);
resultList.push_back(105);
resultList.push_back(99);
resultList.push_back(104);
resultList.push_back(257);
resultList.push_back(32);
resultList.push_back(110);
resultList.push_back(269);
resultList.push_back(104);
resultList.push_back(116);
resultList.push_back(32);
resultList.push_back(107);
resultList.push_back(111);
resultList.push_back(114);
resultList.push_back(114);
resultList.push_back(101);
resultList.push_back(107);
resultList.push_back(277);
resultList.push_back(100);
resultList.push_back(97);
resultList.push_back(114);
resultList.push_back(103);
resultList.push_back(101);
resultList.push_back(115);
resultList.push_back(116);
resultList.push_back(101);
resultList.push_back(108);
resultList.push_back(108);
resultList.push_back(277);
resultList.push_back(119);
resultList.push_back(265);
resultList.push_back(264);
resultList.push_back(110);
resultList.push_back(44);
resultList.push_back(32);
resultList.push_back(115);
resultList.push_back(111);
resultList.push_back(32);
resultList.push_back(108);
resultList.push_back(105);
resultList.push_back(101);
resultList.push_back(103);
resultList.push_back(277);
resultList.push_back(290);
resultList.push_back(32);
resultList.push_back(98);
resultList.push_back(268);
resultList.push_back(32);
resultList.push_back(65);
resultList.push_back(83);
resultList.push_back(67);
resultList.push_back(73);
resultList.push_back(73);
resultList.push_back(45);
resultList.push_back(90);
resultList.push_back(268);
resultList.push_back(270);
resultList.push_back(272);
resultList.push_back(111);
resultList.push_back(313);
resultList.push_back(114);
resultList.push_back(104);
resultList.push_back(97);
resultList.push_back(108);
resultList.push_back(98);
resultList.push_back(32);
resultList.push_back(49);
resultList.push_back(50);
resultList.push_back(55);
resultList.push_back(32);
resultList.push_back(97);
resultList.push_back(259);
resultList.push_back(264);
resultList.push_back(114);
resultList.push_back(32);
resultList.push_back(322);
resultList.push_back(275);
resultList.push_back(257);
resultList.push_back(115);
resultList.push_back(97);
resultList.push_back(116);
resultList.push_back(122);
resultList.push_back(45);
resultList.push_back(69);
resultList.push_back(105);
resultList.push_back(110);
resultList.push_back(291);
resultList.push_back(293);
resultList.push_back(108);
resultList.push_back(117);
resultList.push_back(110);
resultList.push_back(103);
resultList.push_back(46);
resultTrie.clear();
resultTrie.push_back(87);
resultTrie.push_back(101);
resultTrie.push_back(110);
resultTrie.push_back(110);
resultTrie.push_back(32);
resultTrie.push_back(83);
resultTrie.push_back(111);
resultTrie.push_back(110);
resultTrie.push_back(100);
resultTrie.push_back(101);
resultTrie.push_back(114);
resultTrie.push_back(122);
resultTrie.push_back(101);
resultTrie.push_back(105);
resultTrie.push_back(99);
resultTrie.push_back(104);
resultTrie.push_back(476);
resultTrie.push_back(32);
resultTrie.push_back(110);
resultTrie.push_back(1009);
resultTrie.push_back(104);
resultTrie.push_back(116);
resultTrie.push_back(32);
resultTrie.push_back(107);
resultTrie.push_back(111);
resultTrie.push_back(114);
resultTrie.push_back(114);
resultTrie.push_back(101);
resultTrie.push_back(107);
resultTrie.push_back(1058);
resultTrie.push_back(100);
resultTrie.push_back(97);
resultTrie.push_back(114);
resultTrie.push_back(103);
resultTrie.push_back(101);
resultTrie.push_back(115);
resultTrie.push_back(116);
resultTrie.push_back(101);
resultTrie.push_back(108);
resultTrie.push_back(108);
resultTrie.push_back(1058);
resultTrie.push_back(119);
resultTrie.push_back(1334);
resultTrie.push_back(402);
resultTrie.push_back(110);
resultTrie.push_back(44);
resultTrie.push_back(32);
resultTrie.push_back(115);
resultTrie.push_back(111);
resultTrie.push_back(32);
resultTrie.push_back(108);
resultTrie.push_back(105);
resultTrie.push_back(101);
resultTrie.push_back(103);
resultTrie.push_back(1058);
resultTrie.push_back(1551);
resultTrie.push_back(32);
resultTrie.push_back(98);
resultTrie.push_back(1426);
resultTrie.push_back(32);
resultTrie.push_back(65);
resultTrie.push_back(83);
resultTrie.push_back(67);
resultTrie.push_back(73);
resultTrie.push_back(73);
resultTrie.push_back(45);
resultTrie.push_back(90);
resultTrie.push_back(1426);
resultTrie.push_back(810);
resultTrie.push_back(1318);
resultTrie.push_back(111);
resultTrie.push_back(265);
resultTrie.push_back(114);
resultTrie.push_back(104);
resultTrie.push_back(97);
resultTrie.push_back(108);
resultTrie.push_back(98);
resultTrie.push_back(32);
resultTrie.push_back(49);
resultTrie.push_back(50);
resultTrie.push_back(55);
resultTrie.push_back(32);
resultTrie.push_back(97);
resultTrie.push_back(381);
resultTrie.push_back(402);
resultTrie.push_back(114);
resultTrie.push_back(32);
resultTrie.push_back(893);
resultTrie.push_back(711);
resultTrie.push_back(476);
resultTrie.push_back(115);
resultTrie.push_back(97);
resultTrie.push_back(116);
resultTrie.push_back(122);
resultTrie.push_back(45);
resultTrie.push_back(69);
resultTrie.push_back(105);
resultTrie.push_back(110);
resultTrie.push_back(912);
resultTrie.push_back(281);
resultTrie.push_back(108);
resultTrie.push_back(117);
resultTrie.push_back(110);
resultTrie.push_back(103);
resultTrie.push_back(46);
// Hier entsteht die für Test verwendete Datenstruktur
testPhrasesList["Wenn Sonderzeichen nicht korrekt dargestellt werden, so liegt es bei ASCII-Zeichen oberhalb 127 an der Zeichensatz-Einstellung."] = resultList;
testPhrasesTrie["Wenn Sonderzeichen nicht korrekt dargestellt werden, so liegt es bei ASCII-Zeichen oberhalb 127 an der Zeichensatz-Einstellung."] = resultTrie;
}
// Hauptprogramm Unittest
int main(int argc, char** argv) {
// Testphrasen aufbauen
buildPhrases();
// Google Test initialisieren
testing::InitGoogleTest(&argc, argv);
// alle Tests ausführen
int ret = RUN_ALL_TESTS();
// und Ergebnis zurückgeben
return ret;
}