Skip to content

Commit fb81aeb

Browse files
committed
Display more information
1 parent 1a6fe60 commit fb81aeb

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

src/test/TestCompressedStream.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ using namespace kanzi;
2525

2626
uint64 compress1(byte block[], uint length)
2727
{
28-
cout << "Test - Regular" << endl;
28+
cout << "Test - Regular (RLT+TEXT&HUFFMAN)" << endl;
2929
uint blockSize = (length / (1 + (rand() & 3))) & -16;
3030
byte* buf = new byte[length];
3131
memcpy(&buf[0], &block[0], size_t(length));
@@ -72,14 +72,18 @@ uint64 compress2(byte block[], uint length)
7272
jobs = 1;
7373
cout << "Test - ";
7474
#endif
75-
7675
if (checksum == 0)
77-
cout << "no checksum" << endl;
76+
cout << "no checksum";
7877
else
79-
cout << checksum << " bits checksum" << endl;
78+
cout << checksum << " bits checksum";
79+
80+
cout << " (LZX&ANS0)" << endl;
8081

8182
byte* buf = new byte[length];
8283
memcpy(&buf[0], &block[0], size_t(length));
84+
ofstream ofs("/tmp/data.bin");
85+
ofs.write((const char*)block, length);
86+
ofs.close();
8387
stringbuf buffer;
8488
iostream ios(&buffer);
8589
CompressedOutputStream* cos = new CompressedOutputStream(ios, jobs, "ANS0", "LZX", blockSize, checksum);
@@ -111,7 +115,7 @@ uint64 compress2(byte block[], uint length)
111115

112116
uint64 compress3(byte block[], uint length)
113117
{
114-
cout << "Test - incompressible data" << endl;
118+
cout << "Test - incompressible data (LZP+RLT&FPAQ)" << endl;
115119
uint blockSize = (length / (1 + (rand() & 3))) & -16;
116120
byte* buf = new byte[length];
117121
memcpy(&buf[0], &block[0], size_t(length));
@@ -150,7 +154,7 @@ uint64 compress4(byte block[], uint length)
150154
uint64 res;
151155

152156
try {
153-
cout << "Test - write after close" << endl;
157+
cout << "Test - write after close (TEXT&HUFFMAN)" << endl;
154158
stringbuf buffer;
155159
iostream os(&buffer);
156160
cos = new CompressedOutputStream(os, 1, "HUFFMAN", "TEXT");
@@ -176,7 +180,7 @@ uint64 compress5(byte block[], uint length)
176180
uint64 res;
177181

178182
try {
179-
cout << "Test - read after close" << endl;
183+
cout << "Test - read after close (TEXT&HUFFMAN)" << endl;
180184
stringbuf buffer;
181185
iostream ios(&buffer);
182186
cos = new CompressedOutputStream(ios, 1, "HUFFMAN", "TEXT");

src/test/TestTransforms.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ int testTransformsCorrectness(const string& name)
279279
cout << endl
280280
<< "Original: " << endl;
281281

282-
if (ii == 1) {
282+
if (ii == 11) {
283283
cout << "1 8 (" << (size - 1) << " times)";
284284
}
285285
else {
@@ -349,7 +349,7 @@ int testTransformsCorrectness(const string& name)
349349

350350
cout << "Decoded: " << endl;
351351

352-
if (ii == 1) {
352+
if (ii == 11) {
353353
cout << "1 8 (" << (size - 1) << " times)";
354354
}
355355
else {

0 commit comments

Comments
 (0)