summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJia Tan <jiat0218@gmail.com>2022-12-29 21:52:15 +0800
committerJia Tan <jiat0218@gmail.com>2023-03-13 20:49:53 +0800
commitaf55191102f01e76de658c881299f0909ca0feda (patch)
treed4241a006c741ad84ad86b91f3e5e67f1daad9cd /tests
parent8f38cdd9ab71e2a9d5a9787550222b7578243b73 (diff)
downloadxz-af55191102f01e76de658c881299f0909ca0feda.tar.gz
liblzma: Defines masks for return values from lzma_index_checks().
Diffstat (limited to 'tests')
-rw-r--r--tests/test_index.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/test_index.c b/tests/test_index.c
index f63d2a7..b8efebc 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);
}