liblzma: Initialize lzma_lz_encoder pointers with NULL.
[xz.git] / tests / tests.h
blob2d427000d36536e948b6c7c7899d1f7d322f32db
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 /// \file tests.h
4 /// \brief Common definitions for test applications
5 //
6 // Author: Lasse Collin
7 //
8 // This file has been put into the public domain.
9 // You can do whatever you want with this file.
11 ///////////////////////////////////////////////////////////////////////////////
13 #ifndef LZMA_TESTS_H
14 #define LZMA_TESTS_H
16 #include "sysdefs.h"
17 #include "tuklib_integer.h"
18 #include "lzma.h"
19 #include "tuktest.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] = {
34 "LZMA_OK",
35 "LZMA_STREAM_END",
36 "LZMA_NO_CHECK",
37 "LZMA_UNSUPPORTED_CHECK",
38 "LZMA_GET_CHECK",
39 "LZMA_MEM_ERROR",
40 "LZMA_MEMLIMIT_ERROR",
41 "LZMA_FORMAT_ERROR",
42 "LZMA_OPTIONS_ERROR",
43 "LZMA_DATA_ERROR",
44 "LZMA_BUF_ERROR",
45 "LZMA_PROG_ERROR",
46 "LZMA_SEEK_NEEDED",
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] = {
54 "LZMA_CHECK_NONE",
55 "LZMA_CHECK_CRC32",
56 "LZMA_CHECK_UNKNOWN_2",
57 "LZMA_CHECK_UNKNOWN_3",
58 "LZMA_CHECK_CRC64",
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",
64 "LZMA_CHECK_SHA256",
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)
75 #endif