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

Function test_compress

lib_acl_cpp/samples/zlib/zlib.cpp:84–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84static 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
111static void test_zlib_pipe(void)
112{

Callers 1

mainFunction · 0.85

Calls 4

zlib_compressMethod · 0.80
zlib_uncompressMethod · 0.80
lengthMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…