MCPcopy Create free account
hub / github.com/acl-dev/acl / test_unzip_file

Function test_unzip_file

lib_acl_cpp/samples/zlib/zlib.cpp:215–238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213}
214
215static void test_unzip_file(void)
216{
217 const char* file = "test.gz";
218 acl::string buf;
219 if (acl::ifstream::load(file, &buf) == false)
220 return;
221 const char* ptr = buf.c_str() + 10;
222 acl::zlib_stream zstream;
223 if (zstream.unzip_begin(false) == false)
224 return;
225 acl::string out;
226 if (zstream.unzip_update(ptr, (int) buf.length() - 10, &out) == false)
227 printf("unzip_update error\r\n");
228 else if (zstream.unzip_finish(&out) == false)
229 {
230 printf(">>%s\r\n", out.c_str());
231 acl::ofstream fp;
232 fp.open_write("result.txt");
233 fp.write(out);
234 printf("unzip_finish error\r\n");
235 }
236 else
237 printf("unzip_finish ok\r\n");
238}
239
240static void test_pipe()
241{

Callers 1

mainFunction · 0.85

Calls 7

unzip_beginMethod · 0.80
unzip_updateMethod · 0.80
unzip_finishMethod · 0.80
c_strMethod · 0.45
lengthMethod · 0.45
open_writeMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…