Build: Fix a typo in autogen.sh
[xz/debian.git] / tests / tests.h
blobf706cab8884b1f3607ead128e94d9370e79d0f30
1 // SPDX-License-Identifier: 0BSD
3 ///////////////////////////////////////////////////////////////////////////////
4 //
5 /// \file tests.h
6 /// \brief Common definitions for test applications
7 //
8 // Author: Lasse Collin
9 //
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef LZMA_TESTS_H
13 #define LZMA_TESTS_H
15 #include "sysdefs.h"
16 #include "tuklib_integer.h"
17 #include "lzma.h"
18 #include "tuktest.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] = {
33 "LZMA_OK",
34 "LZMA_STREAM_END",
35 "LZMA_NO_CHECK",
36 "LZMA_UNSUPPORTED_CHECK",
37 "LZMA_GET_CHECK",
38 "LZMA_MEM_ERROR",
39 "LZMA_MEMLIMIT_ERROR",
40 "LZMA_FORMAT_ERROR",
41 "LZMA_OPTIONS_ERROR",
42 "LZMA_DATA_ERROR",
43 "LZMA_BUF_ERROR",
44 "LZMA_PROG_ERROR",
45 "LZMA_SEEK_NEEDED",
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] = {
53 "LZMA_CHECK_NONE",
54 "LZMA_CHECK_CRC32",
55 "LZMA_CHECK_UNKNOWN_2",
56 "LZMA_CHECK_UNKNOWN_3",
57 "LZMA_CHECK_CRC64",
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",
63 "LZMA_CHECK_SHA256",
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)
74 #endif