| 213 | } |
| 214 | |
| 215 | static 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 | |
| 240 | static void test_pipe() |
| 241 | { |
no test coverage detected
searching dependent graphs…