From c47ecd6d3909d0d3ff48dfd6e2ee41e7c7130b94 Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Thu, 12 Jan 2023 04:14:18 +0200 Subject: Tests: Fix warnings from clang --Wassign-enum. Explicitly casting the integer to lzma_check silences the warning. Since such an invalid value is needed in multiple tests, a constant INVALID_LZMA_CHECK_ID was added to tests.h. The use of 0x1000 for lzma_block.check wasn't optimal as if the underlying type is a char then 0x1000 will be truncated to 0. However, in these test cases the value is ignored, thus even with such truncation the test would have passed. --- tests/test_check.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/test_check.c') diff --git a/tests/test_check.c b/tests/test_check.c index 1d5b3a10..cb1ad251 100644 --- a/tests/test_check.c +++ b/tests/test_check.c @@ -176,7 +176,7 @@ test_lzma_check_size(void) for (lzma_check i = 0; i < ARRAY_SIZE(expected_check_sizes); i++) assert_uint_eq(expected_check_sizes[i], lzma_check_size(i)); - assert_uint_eq(lzma_check_size(LZMA_CHECK_ID_MAX + 1), UINT32_MAX); + assert_uint_eq(lzma_check_size(INVALID_LZMA_CHECK_ID), UINT32_MAX); } -- cgit v1.2.3