diff options
author | Jia Tan <jiat0218@gmail.com> | 2022-12-29 21:52:15 +0800 |
---|---|---|
committer | Jia Tan <jiat0218@gmail.com> | 2023-03-13 20:49:53 +0800 |
commit | af55191102f01e76de658c881299f0909ca0feda (patch) | |
tree | d4241a006c741ad84ad86b91f3e5e67f1daad9cd /tests | |
parent | Tests: Refactors existing lzma_index tests. (diff) | |
download | xz-af55191102f01e76de658c881299f0909ca0feda.tar.xz |
liblzma: Defines masks for return values from lzma_index_checks().
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_index.c | 22 |
1 files changed, 11 insertions, 11 deletions
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); } |