From af55191102f01e76de658c881299f0909ca0feda Mon Sep 17 00:00:00 2001 From: Jia Tan Date: Thu, 29 Dec 2022 21:52:15 +0800 Subject: liblzma: Defines masks for return values from lzma_index_checks(). --- tests/test_index.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'tests') diff --git a/tests/test_index.c b/tests/test_index.c index f63d2a79..b8efebcb 100644 --- a/tests/test_index.c +++ b/tests/test_index.c @@ -204,28 +204,28 @@ test_lzma_index_checks(void) assert_lzma_ret(lzma_index_stream_flags(idx, &stream_flags), LZMA_OK); assert_uint_eq(lzma_index_checks(idx), - UINT32_C(1) << LZMA_CHECK_NONE); + LZMA_INDEX_CHECK_MASK_NONE); // Set the check type to CRC32 and repeat stream_flags.check = LZMA_CHECK_CRC32; assert_lzma_ret(lzma_index_stream_flags(idx, &stream_flags), LZMA_OK); assert_uint_eq(lzma_index_checks(idx), - UINT32_C(1) << LZMA_CHECK_CRC32); + LZMA_INDEX_CHECK_MASK_CRC32); // Set the check type to CRC64 and repeat stream_flags.check = LZMA_CHECK_CRC64; assert_lzma_ret(lzma_index_stream_flags(idx, &stream_flags), LZMA_OK); assert_uint_eq(lzma_index_checks(idx), - UINT32_C(1) << LZMA_CHECK_CRC64); + LZMA_INDEX_CHECK_MASK_CRC64); // Set the check type to SHA256 and repeat stream_flags.check = LZMA_CHECK_SHA256; assert_lzma_ret(lzma_index_stream_flags(idx, &stream_flags), LZMA_OK); assert_uint_eq(lzma_index_checks(idx), - UINT32_C(1) << LZMA_CHECK_SHA256); + LZMA_INDEX_CHECK_MASK_SHA256); // Create second lzma_index and cat to first lzma_index *second = lzma_index_init(NULL); @@ -237,14 +237,14 @@ test_lzma_index_checks(void) LZMA_OK); assert_uint_eq(lzma_index_checks(second), - UINT32_C(1) << LZMA_CHECK_CRC32); + LZMA_INDEX_CHECK_MASK_CRC32); assert_lzma_ret(lzma_index_cat(idx, second, NULL), LZMA_OK); // Index should now have both CRC32 and SHA256 assert_uint_eq(lzma_index_checks(idx), - (UINT32_C(1) << LZMA_CHECK_CRC32) | - (UINT32_C(1) << LZMA_CHECK_SHA256)); + LZMA_INDEX_CHECK_MASK_CRC32 | + LZMA_INDEX_CHECK_MASK_SHA256); // Change the check type of the second Stream to SHA256 stream_flags.check = LZMA_CHECK_SHA256; @@ -253,7 +253,7 @@ test_lzma_index_checks(void) // Index should now have only SHA256 assert_uint_eq(lzma_index_checks(idx), - UINT32_C(1) << LZMA_CHECK_SHA256); + LZMA_INDEX_CHECK_MASK_SHA256); // Test with a third Stream lzma_index *third = lzma_index_init(NULL); @@ -264,14 +264,14 @@ test_lzma_index_checks(void) LZMA_OK); assert_uint_eq(lzma_index_checks(third), - UINT32_C(1) << LZMA_CHECK_CRC64); + LZMA_INDEX_CHECK_MASK_CRC64); assert_lzma_ret(lzma_index_cat(idx, third, NULL), LZMA_OK); // Index should now have CRC64 and SHA256 assert_uint_eq(lzma_index_checks(idx), - (UINT32_C(1) << LZMA_CHECK_CRC64) | - (UINT32_C(1) << LZMA_CHECK_SHA256)); + LZMA_INDEX_CHECK_MASK_CRC64 | + LZMA_INDEX_CHECK_MASK_SHA256); lzma_index_end(idx, NULL); } -- cgit v1.2.3