fix: breakpad use miniz
Some checks failed
sm-rpc / build (Debug, arm-linux-gnueabihf) (push) Successful in 1m34s
sm-rpc / build (Debug, aarch64-linux-gnu) (push) Successful in 2m46s
sm-rpc / build (Debug, host.gcc) (push) Failing after 1m28s
sm-rpc / build (Release, aarch64-linux-gnu) (push) Successful in 2m14s
sm-rpc / build (Release, arm-linux-gnueabihf) (push) Successful in 2m8s
sm-rpc / build (Debug, mipsel-linux-gnu) (push) Successful in 5m35s
sm-rpc / build (Release, host.gcc) (push) Failing after 1m55s
sm-rpc / build (Release, mipsel-linux-gnu) (push) Successful in 7m21s
Some checks failed
sm-rpc / build (Debug, arm-linux-gnueabihf) (push) Successful in 1m34s
sm-rpc / build (Debug, aarch64-linux-gnu) (push) Successful in 2m46s
sm-rpc / build (Debug, host.gcc) (push) Failing after 1m28s
sm-rpc / build (Release, aarch64-linux-gnu) (push) Successful in 2m14s
sm-rpc / build (Release, arm-linux-gnueabihf) (push) Successful in 2m8s
sm-rpc / build (Debug, mipsel-linux-gnu) (push) Successful in 5m35s
sm-rpc / build (Release, host.gcc) (push) Failing after 1m55s
sm-rpc / build (Release, mipsel-linux-gnu) (push) Successful in 7m21s
This commit is contained in:
58
third_party/zlib-ng/test/test_raw.cc
vendored
Normal file
58
third_party/zlib-ng/test/test_raw.cc
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
/* test_raw.cc - Test raw streams. */
|
||||
|
||||
#include "zbuild.h"
|
||||
#ifdef ZLIB_COMPAT
|
||||
# include "zlib.h"
|
||||
#else
|
||||
# include "zlib-ng.h"
|
||||
#endif
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
TEST(raw, basic) {
|
||||
PREFIX3(stream) stream;
|
||||
int err;
|
||||
unsigned char plain[512];
|
||||
size_t i;
|
||||
unsigned char compr[sizeof(plain)];
|
||||
unsigned int compr_len;
|
||||
unsigned char plain_again[sizeof(plain)];
|
||||
|
||||
memset(&stream, 0, sizeof(stream));
|
||||
err = PREFIX(deflateInit2)(&stream, Z_BEST_SPEED, Z_DEFLATED, -15, 8, Z_DEFAULT_STRATEGY);
|
||||
EXPECT_EQ(err, Z_OK);
|
||||
|
||||
for (i = 0; i < sizeof(plain); i++)
|
||||
plain[i] = (unsigned char)i;
|
||||
stream.adler = 0x12345678;
|
||||
stream.next_in = plain;
|
||||
stream.avail_in = (uint32_t)sizeof(plain);
|
||||
stream.next_out = compr;
|
||||
stream.avail_out = (uint32_t)sizeof(compr);
|
||||
err = PREFIX(deflate)(&stream, Z_FINISH);
|
||||
EXPECT_EQ(err, Z_STREAM_END);
|
||||
EXPECT_EQ(stream.adler, 0x12345678);
|
||||
compr_len = sizeof(compr) - stream.avail_out;
|
||||
|
||||
err = PREFIX(deflateEnd)(&stream);
|
||||
EXPECT_EQ(err, Z_OK);
|
||||
|
||||
memset(&stream, 0, sizeof(stream));
|
||||
err = PREFIX(inflateInit2)(&stream, -MAX_WBITS);
|
||||
EXPECT_EQ(err, Z_OK);
|
||||
|
||||
stream.adler = 0x87654321;
|
||||
stream.next_in = compr;
|
||||
stream.avail_in = compr_len;
|
||||
stream.next_out = plain_again;
|
||||
stream.avail_out = (unsigned int)sizeof(plain_again);
|
||||
|
||||
err = PREFIX(inflate)(&stream, Z_NO_FLUSH);
|
||||
EXPECT_EQ(err, Z_STREAM_END);
|
||||
EXPECT_EQ(stream.adler, 0x87654321);
|
||||
|
||||
err = PREFIX(inflateEnd)(&stream);
|
||||
EXPECT_EQ(err, Z_OK);
|
||||
|
||||
EXPECT_TRUE(memcmp(plain_again, plain, sizeof(plain)) == 0);
|
||||
}
|
Reference in New Issue
Block a user