@@ -47,6 +47,12 @@ static Function<byte>* getByteFunction(string name)
47
47
if (name.compare (" ROLZ" ) == 0 )
48
48
return new ROLZCodec ();
49
49
50
+ if (name.compare (" ROLZX" ) == 0 ) {
51
+ Context ctx;
52
+ ctx.putString (" transform" , " ROLZX" );
53
+ return new ROLZCodec (ctx);
54
+ }
55
+
50
56
cout << " No such byte function: " << name << endl;
51
57
return nullptr ;
52
58
}
@@ -67,7 +73,6 @@ int testFunctionsCorrectness(const string& name)
67
73
byte values[80000 ];
68
74
69
75
if (ii == 0 ) {
70
- size = 15 ;
71
76
byte arr[] = {
72
77
(byte)0 , (byte)1 , (byte)2 , (byte)2 , (byte)2 , (byte)2 , (byte)7 , (byte)9 ,
73
78
(byte)9 , (byte)16 , (byte)16 , (byte)16 , (byte)1 , (byte)3 , (byte)3 , (byte)3 ,
@@ -203,7 +208,7 @@ int testFunctionsCorrectness(const string& name)
203
208
}
204
209
205
210
if (f->forward (iba1, iba2, size) == false ) {
206
- if (iba1._index != size) {
211
+ if (( iba1._index != size) || (iba2. _index >= iba1. _index ) ) {
207
212
cout << endl
208
213
<< " No compression (ratio > 1.0), skip reverse" << endl;
209
214
continue ;
@@ -330,7 +335,12 @@ int testFunctionsSpeed(const string& name)
330
335
before = clock ();
331
336
332
337
if (f->forward (iba1, iba2, size) == false ) {
333
- // ZRLT may fail if the input data has too few 0s
338
+ if ((iba1._index != size) || (iba2._index >= iba1._index )) {
339
+ cout << endl
340
+ << " No compression (ratio > 1.0), skip reverse" << endl;
341
+ continue ;
342
+ }
343
+
334
344
cout << " Encoding error" << endl;
335
345
delete f;
336
346
continue ;
0 commit comments