1 // SPDX-License-Identifier: 0BSD
3 ///////////////////////////////////////////////////////////////////////////////
6 /// \brief Common definitions for test applications
8 // Author: Lasse Collin
10 ///////////////////////////////////////////////////////////////////////////////
16 #include "tuklib_integer.h"
21 // Invalid value for the lzma_check enumeration. This must be positive
22 // but small enough to fit into signed char since the underlying type might
23 // one some platform be a signed char.
25 // Don't put LZMA_ at the beginning of the name so that it is obvious that
26 // this constant doesn't come from the API headers.
27 #define INVALID_LZMA_CHECK_ID ((lzma_check)(LZMA_CHECK_ID_MAX + 1))
30 // This table and macro allow getting more readable error messages when
31 // comparing the lzma_ret enumeration values.
32 static const char enum_strings_lzma_ret
[][24] = {
36 "LZMA_UNSUPPORTED_CHECK",
39 "LZMA_MEMLIMIT_ERROR",
48 #define assert_lzma_ret(test_expr, ref_val) \
49 assert_enum_eq(test_expr, ref_val, enum_strings_lzma_ret)
52 static const char enum_strings_lzma_check
[][24] = {
55 "LZMA_CHECK_UNKNOWN_2",
56 "LZMA_CHECK_UNKNOWN_3",
58 "LZMA_CHECK_UNKNOWN_5",
59 "LZMA_CHECK_UNKNOWN_6",
60 "LZMA_CHECK_UNKNOWN_7",
61 "LZMA_CHECK_UNKNOWN_8",
62 "LZMA_CHECK_UNKNOWN_9",
64 "LZMA_CHECK_UNKNOWN_11",
65 "LZMA_CHECK_UNKNOWN_12",
66 "LZMA_CHECK_UNKNOWN_13",
67 "LZMA_CHECK_UNKNOWN_14",
68 "LZMA_CHECK_UNKNOWN_15",
71 #define assert_lzma_check(test_expr, ref_val) \
72 assert_enum_eq(test_expr, ref_val, enum_strings_lzma_check)