@@ -29,23 +29,12 @@ main()
29
29
StampTwoChars stamp;
30
30
GalleySeriesgalley (stamp);
31
31
Blobblob (short_sample,strlen (short_sample));
32
- std::list<std::string> res = galley.ExtractStr (blob);
33
-
34
- std::string str;
35
-
36
- str = res.front ();
37
- is (str, expected1," GalleySeries, fixed size string stamp: First element of shifted list is ok" );
38
- res.pop_front ();
39
-
40
- str = res.front ();
41
- is (str, expected2," GalleySeries, fixed size string stamp: Second element of shifted list is ok" );
42
- res.pop_front ();
43
-
44
- str = res.front ();
45
- is (str, expected3," GalleySeries, fixed size string stamp: Third element of shifted list is ok" );
46
- res.pop_front ();
32
+ std::vector<std::string> res = galley.ExtractStr (blob);
47
33
48
- ok (res.empty ()," GalleySeries, fixed size string stamp: The rest of the list is empty" );
34
+ is (res[0 ], expected1," GalleySeries, fixed size string stamp: First element of shifted list is ok" );
35
+ is (res[1 ], expected2," GalleySeries, fixed size string stamp: Second element of shifted list is ok" );
36
+ is (res[2 ], expected3," GalleySeries, fixed size string stamp: Third element of shifted list is ok" );
37
+ is (res.size (),3 ," GalleySeries, fixed size string stamp: res has 3 items" );
49
38
}
50
39
/* Test Galley Sereies with unlimited size stamp*/
51
40
{/* 5 .. 9*/
@@ -61,26 +50,14 @@ main()
61
50
StampTwoCharsList stamp_charlist;
62
51
GalleySeriesgalley (stamp_charlist);
63
52
64
- std::list <std::string> res = galley.ExtractStr (blob);
53
+ std::vector <std::string> res = galley.ExtractStr (blob);
65
54
std::string str;
66
55
67
- str = res.front ();
68
- is (str, expected1," GalleySeries, unlimited size string stamp: First element of shifted list is ok" );
69
- res.pop_front ();
70
-
71
- str = res.front ();
72
- is (str, expected2," GalleySeries, unlimited size string stamp: Second element of shifted list is ok" );
73
- res.pop_front ();
74
-
75
- str = res.front ();
76
- is (str, expected3," GalleySeries, unlimited size string stamp: Third element of shifted list is ok" );
77
- res.pop_front ();
78
-
79
- str = res.front ();
80
- is (str, expected4," GalleySeries, unlimited size string stamp: Fourth element of shifted list is ok" );
81
- res.pop_front ();
82
-
83
- ok (res.empty ()," GalleySeries, unlimited size string stamp: The rest of the list is empty" );
56
+ is (res[0 ], expected1," GalleySeries, unlimited size string stamp: First element of shifted list is ok" );
57
+ is (res[1 ], expected2," GalleySeries, unlimited size string stamp: Second element of shifted list is ok" );
58
+ is (res[2 ], expected3," GalleySeries, unlimited size string stamp: Third element of shifted list is ok" );
59
+ is (res[3 ], expected4," GalleySeries, unlimited size string stamp: Fourth element of shifted list is ok" );
60
+ is (res.size (),4 ," GalleySeries, unlimited size string stamp: The rest of the list is empty" );
84
61
}
85
62
86
63
{/* 10..13*/
@@ -92,27 +69,24 @@ main()
92
69
StampArithm<unsigned short int > stamp;
93
70
GalleySeriesgalley (stamp);
94
71
Blobblob (short_sample,strlen (short_sample));
95
- std::list <std::vector<char >> res = galley.ExtractBin (blob);
72
+ std::vector <std::vector<char >> res = galley.ExtractBin (blob);
96
73
97
74
std::vector<char > v;
98
75
unsigned short int * data;
99
76
100
- v = res. front () ;
77
+ v = res[ 0 ] ;
101
78
data = (unsigned short int *) &v[0 ];
102
79
is (*data, expected1," GalleySeries, fixed size binary stamp: First element of shifted list is ok" );
103
- res.pop_front ();
104
80
105
- v = res. front () ;
81
+ v = res[ 1 ] ;
106
82
data = (unsigned short int *) &v[0 ];
107
83
is (*data, expected2," GalleySeries, fixed size binary stamp: Second element of shifted list is ok" );
108
- res.pop_front ();
109
84
110
- v = res. front () ;
85
+ v = res[ 2 ] ;
111
86
data = (unsigned short int *) &v[0 ];
112
87
is (*data, expected3," GalleySeries, fixed size binary stamp: Third element of shifted list is ok" );
113
- res.pop_front ();
114
88
115
- ok (res.empty ()," GalleySeries, fixed size binary stamp:The rest of the list is empty " );
89
+ is (res.size (),3 , " GalleySeries, fixed size binary stamp:result has 3 elements " );
116
90
}
117
91
118
92
/* Test Galley Sereies with variated size stamp*/
@@ -131,26 +105,15 @@ main()
131
105
StampSeveralChars stamp;
132
106
GalleySeriesgalley (stamp);
133
107
134
- std::list <std::string> res = galley.ExtractStr (blob);
108
+ std::vector <std::string> res = galley.ExtractStr (blob);
135
109
std::string str;
136
110
137
- str = res.front ();
138
- is (str, expected1," GalleySeries, unlimited size string stamp: First element of shifted list is ok" );
139
- res.pop_front ();
140
-
141
- str = res.front ();
142
- is (str, expected2," GalleySeries, unlimited size string stamp: Second element of shifted list is ok" );
143
- res.pop_front ();
111
+ is (res[0 ], expected1," GalleySeries, unlimited size string stamp: First element of shifted list is ok" );
112
+ is (res[1 ], expected2," GalleySeries, unlimited size string stamp: Second element of shifted list is ok" );
113
+ is (res[2 ], expected3," GalleySeries, unlimited size string stamp: Third element of shifted list is ok" );
114
+ is (res[3 ], expected4," GalleySeries, unlimited size string stamp: Fourth element of shifted list is ok" );
144
115
145
- str = res.front ();
146
- is (str, expected3," GalleySeries, unlimited size string stamp: Third element of shifted list is ok" );
147
- res.pop_front ();
148
-
149
- str = res.front ();
150
- is (str, expected4," GalleySeries, unlimited size string stamp: Fourth element of shifted list is ok" );
151
- res.pop_front ();
152
-
153
- ok (res.empty ()," GalleySeries, unlimited size string stamp: The rest of the list is empty" );
116
+ is (res.size (),4 ," GalleySeries, unlimited size string stamp: The list has only 4 members" );
154
117
155
118
}
156
119
@@ -242,11 +205,9 @@ main()
242
205
std::vector<std::string> res = galley.ExtractStr (blob);
243
206
std::string str;
244
207
245
- str = res[0 ];
246
- is (str, expected1," GalleySet, unbounded size string stamp: First element of vector is ok" );
208
+ is (res[0 ], expected1," GalleySet, unbounded size string stamp: First element of vector is ok" );
247
209
248
- str = res[1 ];
249
- is (str, expected2," GalleySet, unbounded size string stamp: Second element of vector is ok" );
210
+ is (res[1 ], expected2," GalleySet, unbounded size string stamp: Second element of vector is ok" );
250
211
251
212
is (res.size (),2 ," GalleySet, unbounded size string stamp: The vector has only two elements" );
252
213