| 82 | } |
| 83 | |
| 84 | static int test_compress(void) |
| 85 | { |
| 86 | printf("-----------------------------------------------\r\n"); |
| 87 | |
| 88 | const char* dummy = "�������������������������\r\n"; |
| 89 | acl::zlib_stream zstream; |
| 90 | acl::string out, out2; |
| 91 | |
| 92 | if (zstream.zlib_compress(dummy, (int) strlen(dummy), |
| 93 | &out, acl::zlib_best_compress) == false) |
| 94 | { |
| 95 | printf("zlib_compress error\r\n"); |
| 96 | return 1; |
| 97 | } |
| 98 | |
| 99 | printf(">>after compress, len: %d\r\n", (int) out.length()); |
| 100 | |
| 101 | if (zstream.zlib_uncompress(out.c_str(), (int) out.length(), &out2) == false) |
| 102 | { |
| 103 | printf("zlib_uncompress error\r\n"); |
| 104 | return 1; |
| 105 | } |
| 106 | |
| 107 | printf(">>len: %d, result: %s\r\n", (int) out2.length(), out2.c_str()); |
| 108 | return 0; |
| 109 | } |
| 110 | |
| 111 | static void test_zlib_pipe(void) |
| 112 | { |
no test coverage detected
searching dependent graphs…