Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
tests.h
Go to the documentation of this file.
1// SPDX-License-Identifier: 0BSD
2
4//
7//
8// Author: Lasse Collin
9//
11
12#ifndef LZMA_TESTS_H
13#define LZMA_TESTS_H
14
15#include "sysdefs.h"
16#include "tuklib_integer.h"
17#include "lzma.h"
18#include "tuktest.h"
19
20
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.
24//
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))
28
29
30// This table and macro allow getting more readable error messages when
31// comparing the lzma_ret enumeration values.
32static 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",
46};
47
48#define assert_lzma_ret(test_expr, ref_val) \
49 assert_enum_eq(test_expr, ref_val, enum_strings_lzma_ret)
50
51
52static 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",
69};
70
71#define assert_lzma_check(test_expr, ref_val) \
72 assert_enum_eq(test_expr, ref_val, enum_strings_lzma_check)
73
74#endif
Helper macros for writing simple test programs.