From: Lasse Collin Date: Fri, 19 Apr 2024 17:47:24 +0000 (+0300) Subject: Tests: test_lzip_decoder: Remove unneeded tuktest_malloc() calls X-Git-Tag: v5.7.1alpha~389 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7e4bc53eacfab9f3de95d8252bdfdc9419079c9;p=thirdparty%2Fxz.git Tests: test_lzip_decoder: Remove unneeded tuktest_malloc() calls --- diff --git a/tests/test_lzip_decoder.c b/tests/test_lzip_decoder.c index 90c5819b..01a43019 100644 --- a/tests/test_lzip_decoder.c +++ b/tests/test_lzip_decoder.c @@ -42,7 +42,7 @@ basic_lzip_decode(const char *src, const uint32_t expected_crc) lzma_stream strm = LZMA_STREAM_INIT; assert_lzma_ret(lzma_lzip_decoder(&strm, MEMLIMIT, 0), LZMA_OK); - uint8_t *output_buffer = tuktest_malloc(DECODE_CHUNK_SIZE); + uint8_t output_buffer[DECODE_CHUNK_SIZE]; strm.next_in = data; strm.next_out = output_buffer; @@ -58,10 +58,6 @@ basic_lzip_decode(const char *src, const uint32_t expected_crc) checksum = lzma_crc32(output_buffer, (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. - output_buffer = tuktest_malloc(DECODE_CHUNK_SIZE); strm.next_out = output_buffer; strm.avail_out = DECODE_CHUNK_SIZE; } @@ -125,7 +121,7 @@ trailing_helper(const char *src, const uint32_t expected_data_checksum, assert_lzma_ret(lzma_lzip_decoder(&strm, MEMLIMIT, LZMA_CONCATENATED), LZMA_OK); - uint8_t *output_buffer = tuktest_malloc(DECODE_CHUNK_SIZE); + uint8_t output_buffer[DECODE_CHUNK_SIZE]; strm.next_in = data; strm.next_out = output_buffer; @@ -139,10 +135,6 @@ trailing_helper(const char *src, const uint32_t expected_data_checksum, checksum = lzma_crc32(output_buffer, (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. - output_buffer = tuktest_malloc(DECODE_CHUNK_SIZE); strm.next_out = output_buffer; strm.avail_out = DECODE_CHUNK_SIZE; }