mirror of https://git.tukaani.org/xz.git
Tests: Include tuktest.h in tests.h.
This breaks -Werror because none of the tests so far use tuktest.h and thus there are warnings about unused variables and functions.
This commit is contained in:
parent
df71ba1c99
commit
96da21470f
|
@ -16,11 +16,13 @@
|
||||||
#include "sysdefs.h"
|
#include "sysdefs.h"
|
||||||
#include "tuklib_integer.h"
|
#include "tuklib_integer.h"
|
||||||
#include "lzma.h"
|
#include "lzma.h"
|
||||||
|
#include "tuktest.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#define memcrap(buf, size) memset(buf, 0xFD, size)
|
#define memcrap(buf, size) memset(buf, 0xFD, size)
|
||||||
|
|
||||||
|
|
||||||
|
// TODO: Remove these three macros once all tests have been converted.
|
||||||
#define expect(test) ((test) ? 0 : (fprintf(stderr, "%s:%d: %s\n", \
|
#define expect(test) ((test) ? 0 : (fprintf(stderr, "%s:%d: %s\n", \
|
||||||
__FILE__, __LINE__, #test), abort(), 0))
|
__FILE__, __LINE__, #test), abort(), 0))
|
||||||
|
|
||||||
|
@ -29,13 +31,9 @@
|
||||||
#define fail(test) expect(test)
|
#define fail(test) expect(test)
|
||||||
|
|
||||||
|
|
||||||
static inline const char *
|
// This table and macro allow getting more readable error messages when
|
||||||
lzma_ret_sym(lzma_ret ret)
|
// comparing the lzma_ret enumeration values.
|
||||||
{
|
static const char *enum_strings_lzma_ret[] = {
|
||||||
if ((unsigned int)(ret) > LZMA_PROG_ERROR)
|
|
||||||
return "UNKNOWN_ERROR";
|
|
||||||
|
|
||||||
static const char *msgs[] = {
|
|
||||||
"LZMA_OK",
|
"LZMA_OK",
|
||||||
"LZMA_STREAM_END",
|
"LZMA_STREAM_END",
|
||||||
"LZMA_NO_CHECK",
|
"LZMA_NO_CHECK",
|
||||||
|
@ -47,11 +45,12 @@ lzma_ret_sym(lzma_ret ret)
|
||||||
"LZMA_OPTIONS_ERROR",
|
"LZMA_OPTIONS_ERROR",
|
||||||
"LZMA_DATA_ERROR",
|
"LZMA_DATA_ERROR",
|
||||||
"LZMA_BUF_ERROR",
|
"LZMA_BUF_ERROR",
|
||||||
"LZMA_PROG_ERROR"
|
"LZMA_PROG_ERROR",
|
||||||
|
"LZMA_SEEK_NEEDED",
|
||||||
};
|
};
|
||||||
|
|
||||||
return msgs[ret];
|
#define assert_lzma_ret(test_expr, ref_val) \
|
||||||
}
|
assert_enum_eq(test_expr, ref_val, enum_strings_lzma_ret)
|
||||||
|
|
||||||
|
|
||||||
static inline bool
|
static inline bool
|
||||||
|
|
Loading…
Reference in New Issue