aboutsummaryrefslogtreecommitdiff
path: root/tests/test_lzip_decoder.c
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2023-01-12 03:03:55 +0200
committerJia Tan <jiat0218@gmail.com>2023-02-03 21:07:57 +0800
commitc55157ed7437ab14f2afb7fecf331e321f2edf9a (patch)
tree97e35b88a582c4b4f8ac396d760cfa096b8c0b5e /tests/test_lzip_decoder.c
parentBump version and soname for 5.4.1. (diff)
downloadxz-c55157ed7437ab14f2afb7fecf331e321f2edf9a.tar.xz
Tests: test_lzip_decoder: Silence warnings from -Wsign-conversion.
Diffstat (limited to 'tests/test_lzip_decoder.c')
-rw-r--r--tests/test_lzip_decoder.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/test_lzip_decoder.c b/tests/test_lzip_decoder.c
index 306de747..93a7aa25 100644
--- a/tests/test_lzip_decoder.c
+++ b/tests/test_lzip_decoder.c
@@ -56,8 +56,8 @@ basic_lzip_decode(const char *src, const uint32_t expected_crc) {
ret = lzma_code(&strm, LZMA_RUN);
if (strm.avail_out == 0) {
checksum = lzma_crc32(output_buffer,
- strm.next_out - output_buffer,
- checksum);
+ (size_t)(strm.next_out - output_buffer),
+ checksum);
// No need to free output_buffer because it will
// automatically be freed at the end of the test by
// tuktest.
@@ -70,7 +70,8 @@ basic_lzip_decode(const char *src, const uint32_t expected_crc) {
assert_lzma_ret(ret, LZMA_STREAM_END);
assert_uint_eq(strm.total_in, file_size);
- checksum = lzma_crc32(output_buffer, strm.next_out - output_buffer,
+ checksum = lzma_crc32(output_buffer,
+ (size_t)(strm.next_out - output_buffer),
checksum);
assert_uint_eq(checksum, expected_crc);
@@ -133,8 +134,8 @@ trailing_helper(const char *src, const uint32_t expected_data_checksum,
ret = lzma_code(&strm, LZMA_RUN);
if (strm.avail_out == 0) {
checksum = lzma_crc32(output_buffer,
- strm.next_out - output_buffer,
- checksum);
+ (size_t)(strm.next_out - output_buffer),
+ checksum);
// No need to free output_buffer because it will
// automatically be freed at the end of the test by
// tuktest.
@@ -148,7 +149,7 @@ trailing_helper(const char *src, const uint32_t expected_data_checksum,
assert_uint(strm.total_in, <, file_size);
checksum = lzma_crc32(output_buffer,
- strm.next_out - output_buffer,
+ (size_t)(strm.next_out - output_buffer),
checksum);
assert_uint_eq(checksum, expected_data_checksum);