@@ -49,7 +49,7 @@ char longer_sample[]="z1234567*89abcde&fghijklmnopqrstuvwxyzAB%CDEFGHIJKLMNOPQRS
49
49
int
50
50
main ()
51
51
{
52
- TEST_START (13 );
52
+ TEST_START (18 );
53
53
/* Test Galley Sereies with fixed size stampp*/
54
54
{ /* 1..4 */
55
55
std::string expected1 = " 12" ;
77
77
78
78
ok (res.empty (), " GalleySeries, fixed size string stamp: The rest of the list is empty" );
79
79
}
80
- /* Test Galley Sereies with unlimited size stampp */
80
+ /* Test Galley Sereies with unlimited size stamp */
81
81
{ /* 5 .. 9*/
82
82
/* This is not the best test, as we do not predict behavior by setting forged sample values,
83
83
but at least here we check that it work the same way it worked before. May be this test should be improved later*/
@@ -144,5 +144,46 @@ main()
144
144
ok (res.empty (), " GalleySeries, fixed size binary stamp: The rest of the list is empty" );
145
145
}
146
146
147
+ /* Test Galley Sereies with variated size stamp*/
148
+ { /* 14 .. 18*/
149
+ /* This is not the best test, as we do not predict behavior by setting forged sample values,
150
+ but at least here we check that it work the same way it worked before. May be this test should be improved later*/
151
+
152
+ char sample[]=" z1234567*89abcde&fghijklm" ;
153
+
154
+ std::string expected1 = " 234" ;
155
+ std::string expected2 = " 7*8" ;
156
+ std::string expected3 = " bcde" ;
157
+ std::string expected4 = " ghij" ;
158
+
159
+ Blob blob (sample, strlen (sample));
160
+ StampSeveralChars stamp;
161
+ GalleySeries galley (stamp);
162
+
163
+ std::list<std::string> res = galley.ExtractStr (blob);
164
+ std::string str;
165
+
166
+ str = res.front ();
167
+ is (str, expected1, " GalleySeries, unlimited size string stamp: First element of shifted list is ok" );
168
+ res.pop_front ();
169
+
170
+ str = res.front ();
171
+ is (str, expected2, " GalleySeries, unlimited size string stamp: Second element of shifted list is ok" );
172
+ res.pop_front ();
173
+
174
+ str = res.front ();
175
+ is (str, expected3, " GalleySeries, unlimited size string stamp: Third element of shifted list is ok" );
176
+ res.pop_front ();
177
+
178
+ str = res.front ();
179
+ is (str, expected4, " GalleySeries, unlimited size string stamp: Fourth element of shifted list is ok" );
180
+ res.pop_front ();
181
+
182
+ ok (res.empty (), " GalleySeries, unlimited size string stamp: The rest of the list is empty" );
183
+ }
184
+
185
+
186
+
187
+
147
188
TEST_END;
148
189
}
0 commit comments