1 ///////////////////////////////////////////////////////////////////////////////
4 /// \brief Common definitions for test applications
6 // Author: Lasse Collin
8 // This file has been put into the public domain.
9 // You can do whatever you want with this file.
11 ///////////////////////////////////////////////////////////////////////////////
17 #include "tuklib_integer.h"
22 // Invalid value for the lzma_check enumeration. This must be positive
23 // but small enough to fit into signed char since the underlying type might
24 // one some platform be a signed char.
26 // Don't put LZMA_ at the beginning of the name so that it is obvious that
27 // this constant doesn't come from the API headers.
28 #define INVALID_LZMA_CHECK_ID ((lzma_check)(LZMA_CHECK_ID_MAX + 1))
31 // This table and macro allow getting more readable error messages when
32 // comparing the lzma_ret enumeration values.
33 static const char enum_strings_lzma_ret
[][24] = {
37 "LZMA_UNSUPPORTED_CHECK",
40 "LZMA_MEMLIMIT_ERROR",
49 #define assert_lzma_ret(test_expr, ref_val) \
50 assert_enum_eq(test_expr, ref_val, enum_strings_lzma_ret)
53 static const char enum_strings_lzma_check
[][24] = {
56 "LZMA_CHECK_UNKNOWN_2",
57 "LZMA_CHECK_UNKNOWN_3",
59 "LZMA_CHECK_UNKNOWN_5",
60 "LZMA_CHECK_UNKNOWN_6",
61 "LZMA_CHECK_UNKNOWN_7",
62 "LZMA_CHECK_UNKNOWN_8",
63 "LZMA_CHECK_UNKNOWN_9",
65 "LZMA_CHECK_UNKNOWN_11",
66 "LZMA_CHECK_UNKNOWN_12",
67 "LZMA_CHECK_UNKNOWN_13",
68 "LZMA_CHECK_UNKNOWN_14",
69 "LZMA_CHECK_UNKNOWN_15",
72 #define assert_lzma_check(test_expr, ref_val) \
73 assert_enum_eq(test_expr, ref_val, enum_strings_lzma_check)