Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcafc8ce

Browse files
Rename GalleyVector to GalleySet
1 parent9815a3b commitcafc8ce

File tree

3 files changed

+72
-72
lines changed

3 files changed

+72
-72
lines changed

‎blobstamper/galley.cpp‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ GalleySeries::extract_internal(Blob &blob)
157157
/**********************************************/
158158

159159
std::vector<Blob>
160-
GalleyVector::extract_internal(Blob &blob)
160+
GalleySet::extract_internal(Blob &blob)
161161
{
162162
std::vector<Blob> res;
163163
int fixed_total_size =0;// Summ of sizes of fixed parts of all stamps
@@ -323,7 +323,7 @@ GalleyVector::extract_internal(Blob &blob)
323323
}
324324

325325
std::vector<std::string>
326-
GalleyVector::ExtractStr(Blob &blob)
326+
GalleySet::ExtractStr(Blob &blob)
327327
{
328328
std::vector<std::string> res;
329329
std::vector<Blob> blobs =extract_internal(blob);
@@ -338,7 +338,7 @@ GalleyVector::ExtractStr(Blob &blob)
338338
}
339339

340340
std::vector<std::vector<char>>
341-
GalleyVector::ExtractBin(Blob &blob)
341+
GalleySet::ExtractBin(Blob &blob)
342342
{
343343
std::vector<std::vector<char>> res;
344344
std::vector<Blob> blobs =extract_internal(blob);
@@ -353,7 +353,7 @@ GalleyVector::ExtractBin(Blob &blob)
353353
}
354354

355355
int
356-
GalleyVector::minSize()
356+
GalleySet::minSize()
357357
{
358358
bool has_variated_stamps =false;
359359
bool has_unbounded_stamps =false;
@@ -390,7 +390,7 @@ GalleyVector::minSize()
390390
}
391391

392392
int
393-
GalleyVector::maxSize()
393+
GalleySet::maxSize()
394394
{
395395
int res =0;
396396

‎blobstamper/galley.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ class GalleySeries : public GalleyBase
3636
intmaxSize()override {return -1;};/* Sereies always takes as much data as it can take*/
3737
};
3838

39-
classGalleyVector :publicGalleyBase
39+
classGalleySet :publicGalleyBase
4040
{
4141
protected:
4242
std::vector<std::reference_wrapper<StampBase>> stamps;
4343
public:
44-
GalleyVector(std::vector<std::reference_wrapper<StampBase>> arg) : stamps(arg) {};
44+
GalleySet(std::vector<std::reference_wrapper<StampBase>> arg) : stamps(arg) {};
4545
std::vector<Blob>extract_internal(Blob &blob);
4646
std::vector<std::string>ExtractStr(Blob &blob);
4747
std::vector<std::vector<char>>ExtractBin(Blob &blob);

‎t/300-galley.cpp‎

Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ main()
154154

155155
}
156156

157-
/* TestGalley Vector with fixed size stamps*/
157+
/* TestGalleySet with fixed size stamps*/
158158
{/* 19 .. 22*/
159159

160160
char sample[]="z1234567*89abcde&fghijklm";
@@ -170,25 +170,25 @@ main()
170170
stamps.push_back(stamp);
171171
stamps.push_back(stamp);
172172

173-
GalleyVectorgalley(stamps);
173+
GalleySetgalley(stamps);
174174

175175
std::vector<std::string> res = galley.ExtractStr(blob);
176176
std::string str;
177177
str = res[0];
178-
is(str, expected1,"GalleyVector, fixed size string stamps: First element of vector is ok");
178+
is(str, expected1,"GalleySet, fixed size string stamps: First element of vector is ok");
179179

180180
str = res[1];
181-
is(str, expected2,"GalleyVector, fixed size string stamps: Second element of vector is ok");
181+
is(str, expected2,"GalleySet, fixed size string stamps: Second element of vector is ok");
182182

183-
is(res.size(),2,"GalleyVector, fixed size string stamps: The vector has only two elements");
183+
is(res.size(),2,"GalleySet, fixed size string stamps: The vector has only two elements");
184184

185-
is(blob.Size(),strlen(sample) - res[0].length() - res[1].length(),"GalleyVector: shifts no extra bytes for fixed stamps");
185+
is(blob.Size(),strlen(sample) - res[0].length() - res[1].length(),"GalleySet: shifts no extra bytes for fixed stamps");
186186

187-
is(galley.minSize(), stamp.minSize()*2,"GalleyVector, fixed size string stamps: galley min size is ok");
188-
is(galley.maxSize(), stamp.maxSize()*2,"GalleyVector, fixed size string stamps: galley max size is ok");
187+
is(galley.minSize(), stamp.minSize()*2,"GalleySet, fixed size string stamps: galley min size is ok");
188+
is(galley.maxSize(), stamp.maxSize()*2,"GalleySet, fixed size string stamps: galley max size is ok");
189189
}
190190

191-
/* Test GalleyVector with variated size stamps*/
191+
/* Test GalleySet with variated size stamps*/
192192
{/* 25 .. 30*/
193193

194194
char sample[]="z1234567*89abcde&fghijklm";
@@ -203,26 +203,26 @@ main()
203203
stamps.push_back(stamp);
204204
stamps.push_back(stamp);
205205

206-
GalleyVectorgalley(stamps);
206+
GalleySetgalley(stamps);
207207

208208
std::vector<std::string> res = galley.ExtractStr(blob);
209209
std::string str;
210210

211211
str = res[0];
212-
is(str, expected1,"GalleyVector, variated size string stamp: First element of vector is ok");
212+
is(str, expected1,"GalleySet, variated size string stamp: First element of vector is ok");
213213

214214
str = res[1];
215-
is(str, expected2,"GalleyVector, variated size string stamp: Second element of vector is ok");
215+
is(str, expected2,"GalleySet, variated size string stamp: Second element of vector is ok");
216216

217-
is(res.size(),2,"GalleyVector, variated size string stamp: The vector has only two elements");
217+
is(res.size(),2,"GalleySet, variated size string stamp: The vector has only two elements");
218218

219-
is(blob.Size(),strlen(sample) - res[0].length() - res[1].length() - ORACLE_SIZE*2,"GalleyVector: shifts one oracle for each variated stamps");
219+
is(blob.Size(),strlen(sample) - res[0].length() - res[1].length() - ORACLE_SIZE*2,"GalleySet: shifts one oracle for each variated stamps");
220220

221-
is(galley.minSize(), stamp.minSize()*2 + ORACLE_SIZE *2,"GalleyVector, variated size string stamps: galley min size is ok");
222-
is(galley.maxSize(), stamp.maxSize()*2 + ORACLE_SIZE *2,"GalleyVector, variated size string stamps: galley max size is ok");
221+
is(galley.minSize(), stamp.minSize()*2 + ORACLE_SIZE *2,"GalleySet, variated size string stamps: galley min size is ok");
222+
is(galley.maxSize(), stamp.maxSize()*2 + ORACLE_SIZE *2,"GalleySet, variated size string stamps: galley max size is ok");
223223
}
224224

225-
/* Test GalleyVector with unbounded size stamps*/
225+
/* Test GalleySet with unbounded size stamps*/
226226
{/* 31 .. 36*/
227227

228228
char sample[]="z1234567*89abcde&fghijklm";
@@ -237,27 +237,27 @@ main()
237237
stamps.push_back(stamp);
238238
stamps.push_back(stamp);
239239

240-
GalleyVectorgalley(stamps);
240+
GalleySetgalley(stamps);
241241

242242
std::vector<std::string> res = galley.ExtractStr(blob);
243243
std::string str;
244244

245245
str = res[0];
246-
is(str, expected1,"GalleyVector, unbounded size string stamp: First element of vector is ok");
246+
is(str, expected1,"GalleySet, unbounded size string stamp: First element of vector is ok");
247247

248248
str = res[1];
249-
is(str, expected2,"GalleyVector, unbounded size string stamp: Second element of vector is ok");
249+
is(str, expected2,"GalleySet, unbounded size string stamp: Second element of vector is ok");
250250

251-
is(res.size(),2,"GalleyVector, unbounded size string stamp: The vector has only two elements");
251+
is(res.size(),2,"GalleySet, unbounded size string stamp: The vector has only two elements");
252252

253-
is(blob.Size(),0 ,"GalleyVector: will use all data for unbounded stamp");
253+
is(blob.Size(),0 ,"GalleySet: will use all data for unbounded stamp");
254254

255-
is(galley.minSize(), stamp.minSize()*2 + ORACLE_SIZE *2,"GalleyVector, unbounded size string stamps: galley min size is ok");
256-
is(galley.maxSize(), -1,"GalleyVector, unbounded size string stamps: galley max size is ok");
255+
is(galley.minSize(), stamp.minSize()*2 + ORACLE_SIZE *2,"GalleySet, unbounded size string stamps: galley min size is ok");
256+
is(galley.maxSize(), -1,"GalleySet, unbounded size string stamps: galley max size is ok");
257257

258258
}
259259

260-
/* Test GalleyVector with mixed stam types*/
260+
/* Test GalleySet with mixed stam types*/
261261
{/* 37 .. 46*/
262262

263263
char sample[]="z1234567*89abcde&fghijklmnopqrstuvwxyzAB%CDEFGHIJKLMNOPQRSTUVWXYZ!";
@@ -284,38 +284,38 @@ main()
284284
stamps.push_back(u_stamp);
285285
stamps.push_back(f_stamp);
286286

287-
GalleyVectorgalley(stamps);
287+
GalleySetgalley(stamps);
288288

289289
std::vector<std::string> res = galley.ExtractStr(blob);
290290
std::string str;
291291

292292
str = res[0];
293-
is(str, expected1,"GalleyVector, mixed type stamps: First unbounded stamp is ok");
293+
is(str, expected1,"GalleySet, mixed type stamps: First unbounded stamp is ok");
294294

295295
str = res[1];
296-
is(str, expected2,"GalleyVector, mixed type stamps: Fist varieded stamp is ok");
296+
is(str, expected2,"GalleySet, mixed type stamps: Fist varieded stamp is ok");
297297

298298
str = res[2];
299-
is(str, expected3,"GalleyVector, mixed type stamps: Second variated stamp is ok");
299+
is(str, expected3,"GalleySet, mixed type stamps: Second variated stamp is ok");
300300

301301
str = res[3];
302-
is(str, expected4,"GalleyVector, mixed type stamps: First fixed stamp is ok");
302+
is(str, expected4,"GalleySet, mixed type stamps: First fixed stamp is ok");
303303

304304
str = res[4];
305-
is(str, expected5,"GalleyVector, mixed type stamps: Second unbounded stamp is ok");
305+
is(str, expected5,"GalleySet, mixed type stamps: Second unbounded stamp is ok");
306306

307307
str = res[5];
308-
is(str, expected6,"GalleyVector, mixed type stamps: Second fixed stamp is ok");
308+
is(str, expected6,"GalleySet, mixed type stamps: Second fixed stamp is ok");
309309

310-
is(res.size(),6,"GalleyVector, mixed type stamps: The vector has only six elements");
310+
is(res.size(),6,"GalleySet, mixed type stamps: The vector has only six elements");
311311

312-
is(blob.Size(),0 ,"GalleyVector: will use all data if we have at least one unbounded stamp");
312+
is(blob.Size(),0 ,"GalleySet: will use all data if we have at least one unbounded stamp");
313313

314-
is(galley.minSize(), (f_stamp.minSize()+v_stamp.minSize()+u_stamp.minSize())*2 + ORACLE_SIZE * (2+2+1),"GalleyVector, mixed types stamps: galley min size is ok");
315-
is(galley.maxSize(), -1,"GalleyVector, mixed types stamps: galley max size is ok");
314+
is(galley.minSize(), (f_stamp.minSize()+v_stamp.minSize()+u_stamp.minSize())*2 + ORACLE_SIZE * (2+2+1),"GalleySet, mixed types stamps: galley min size is ok");
315+
is(galley.maxSize(), -1,"GalleySet, mixed types stamps: galley max size is ok");
316316
}
317317

318-
/* Test GalleyVector, single unbounded stamp will use all data with no oracle to predict it*/
318+
/* Test GalleySet, single unbounded stamp will use all data with no oracle to predict it*/
319319
{/* 47 .. 53*/
320320

321321
char sample[]="z1234567*89abcde&fghijklmnopqrstuvwxyzAB%CDEFGHIJKLMNOPQRSTUVWXYZ!";
@@ -335,29 +335,29 @@ main()
335335
stamps.push_back(u_stamp);
336336
stamps.push_back(f_stamp);
337337

338-
GalleyVectorgalley(stamps);
338+
GalleySetgalley(stamps);
339339

340340
std::vector<std::string> res = galley.ExtractStr(blob);
341341
std::string str;
342342

343343
str = res[0];
344-
is(str, expected1,"GalleyVector, mixed type stamps 2: First unbounded stamp is ok");
344+
is(str, expected1,"GalleySet, mixed type stamps 2: First unbounded stamp is ok");
345345

346346
str = res[1];
347-
is(str, expected2,"GalleyVector, mixed type stamps 2: Fist varieded stamp is ok");
347+
is(str, expected2,"GalleySet, mixed type stamps 2: Fist varieded stamp is ok");
348348

349349
str = res[2];
350-
is(str, expected3,"GalleyVector, mixed type stamps 2: Second variated stamp is ok");
350+
is(str, expected3,"GalleySet, mixed type stamps 2: Second variated stamp is ok");
351351

352-
is(res.size(),3,"GalleyVector, mixed type stamps 2: The vector has only three elements");
352+
is(res.size(),3,"GalleySet, mixed type stamps 2: The vector has only three elements");
353353

354-
is(blob.Size(),0 ,"GalleyVector 2: will use all data if we have at least one unbounded stamp");
354+
is(blob.Size(),0 ,"GalleySet 2: will use all data if we have at least one unbounded stamp");
355355

356-
is(galley.minSize(), f_stamp.minSize()*2 + u_stamp.minSize() ,"GalleyVector 2, mixed types stamps: galley min size is ok");
357-
is(galley.maxSize(), -1,"GalleyVector, mixed types stamps 2: galley max size is ok");
356+
is(galley.minSize(), f_stamp.minSize()*2 + u_stamp.minSize() ,"GalleySet 2, mixed types stamps: galley min size is ok");
357+
is(galley.maxSize(), -1,"GalleySet, mixed types stamps 2: galley max size is ok");
358358
}
359359

360-
/* Test GalleyVector, when there are only minimal amound of data available*/
360+
/* Test GalleySet, when there are only minimal amound of data available*/
361361
{/* 54 .. 63*/
362362

363363
char sample[] ="oo""oo""oo""oo""oo""z1""23""45""67""89""ab";
@@ -383,38 +383,38 @@ main()
383383
stamps.push_back(u_stamp);
384384
stamps.push_back(f_stamp);
385385

386-
GalleyVectorgalley(stamps);
386+
GalleySetgalley(stamps);
387387

388388
std::vector<std::string> res = galley.ExtractStr(blob);
389389
std::string str;
390390

391391
str = res[0];
392-
is(str, expected1,"GalleyVector, mixed type stamps 3: First unbounded stamp is ok");
392+
is(str, expected1,"GalleySet, mixed type stamps 3: First unbounded stamp is ok");
393393

394394
str = res[1];
395-
is(str, expected2,"GalleyVector, mixed type stamps 3: Fist varieded stamp is ok");
395+
is(str, expected2,"GalleySet, mixed type stamps 3: Fist varieded stamp is ok");
396396

397397
str = res[2];
398-
is(str, expected3,"GalleyVector, mixed type stamps 3: Second variated stamp is ok");
398+
is(str, expected3,"GalleySet, mixed type stamps 3: Second variated stamp is ok");
399399

400400
str = res[3];
401-
is(str, expected4,"GalleyVector, mixed type stamps 3: First fixed stamp is ok");
401+
is(str, expected4,"GalleySet, mixed type stamps 3: First fixed stamp is ok");
402402

403403
str = res[4];
404-
is(str, expected5,"GalleyVector, mixed type stamps 3: Second unbounded stamp is ok");
404+
is(str, expected5,"GalleySet, mixed type stamps 3: Second unbounded stamp is ok");
405405

406406
str = res[5];
407-
is(str, expected6,"GalleyVector, mixed type stamps 3: Second fixed stamp is ok");
407+
is(str, expected6,"GalleySet, mixed type stamps 3: Second fixed stamp is ok");
408408

409-
is(res.size(),6,"GalleyVector, mixed type stamps 3: The vector has only six elements");
409+
is(res.size(),6,"GalleySet, mixed type stamps 3: The vector has only six elements");
410410

411-
is(blob.Size(),0 ,"GalleyVector 3: will use all data if we have at least one unbounded stamp");
411+
is(blob.Size(),0 ,"GalleySet 3: will use all data if we have at least one unbounded stamp");
412412

413-
is(galley.minSize(), (f_stamp.minSize()+v_stamp.minSize()+u_stamp.minSize())*2 + ORACLE_SIZE * (2+2+1),"GalleyVector, mixed types stamps 3: galley min size is ok");
414-
is(galley.maxSize(), -1,"GalleyVector, mixed types stamps 3: galley max size is ok");
413+
is(galley.minSize(), (f_stamp.minSize()+v_stamp.minSize()+u_stamp.minSize())*2 + ORACLE_SIZE * (2+2+1),"GalleySet, mixed types stamps 3: galley min size is ok");
414+
is(galley.maxSize(), -1,"GalleySet, mixed types stamps 3: galley max size is ok");
415415
}
416416

417-
/* Test GalleyVector, when there are not enought data*/
417+
/* Test GalleySet, when there are not enought data*/
418418
{/* 64 .. 67*/
419419

420420
char sample[] ="oo""oo""oo""oo""oo""z1""23""45""67""89""a";
@@ -433,24 +433,24 @@ main()
433433
stamps.push_back(u_stamp);
434434
stamps.push_back(f_stamp);
435435

436-
GalleyVectorgalley(stamps);
436+
GalleySetgalley(stamps);
437437
try{
438438
std::vector<std::string> res = galley.ExtractStr(blob);
439-
ok(false,"Galley Vector, not enough data");
439+
ok(false,"GalleySet, not enough data");
440440
}
441441
catch (OutOfData)
442442
{
443-
ok(true,"Galley Vector, not enough data");
443+
ok(true,"GalleySet, not enough data");
444444
}
445445
catch (...)//Any other exeption
446446
{
447-
ok(false,"Galley Vector, not enough data");
447+
ok(false,"GalleySet, not enough data");
448448
}
449449

450-
is(blob.Size(),strlen(sample) ,"GalleyVector 4: will use keep all data when applying galley fails");
450+
is(blob.Size(),strlen(sample) ,"GalleySet 4: will use keep all data when applying galley fails");
451451

452-
is(galley.minSize(), (f_stamp.minSize()+v_stamp.minSize()+u_stamp.minSize())*2 + ORACLE_SIZE * (2+2+1),"GalleyVector, mixed types stamps 4: galley min size is ok");
453-
is(galley.maxSize(), -1,"GalleyVector, mixed types stamps 4: galley max size is ok");
452+
is(galley.minSize(), (f_stamp.minSize()+v_stamp.minSize()+u_stamp.minSize())*2 + ORACLE_SIZE * (2+2+1),"GalleySet, mixed types stamps 4: galley min size is ok");
453+
is(galley.maxSize(), -1,"GalleySet, mixed types stamps 4: galley max size is ok");
454454
}
455455
TEST_END;
456456
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp