mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-23 17:34:00 +03:00
test-compress*: silence warning about unused definitions when w/o both xz and lz4
I think it's nice to mark the test as skipped instead of omitting it entirely, hence #ifdefs in the code instead of excluding the test in Makefile.am/meson.build.
This commit is contained in:
parent
86cebca72b
commit
ccc717fa5c
@ -30,6 +30,8 @@ typedef int (compress_t)(const void *src, uint64_t src_size, void *dst,
|
||||
typedef int (decompress_t)(const void *src, uint64_t src_size,
|
||||
void **dst, size_t *dst_alloc_size, size_t* dst_size, size_t dst_max);
|
||||
|
||||
#if defined(HAVE_XZ) || defined(HAVE_LZ4)
|
||||
|
||||
static usec_t arg_duration = 2 * USEC_PER_SEC;
|
||||
static size_t arg_start;
|
||||
|
||||
@ -151,8 +153,10 @@ static void test_compress_decompress(const char* label, const char* type,
|
||||
100 - compressed * 100. / total,
|
||||
skipped);
|
||||
}
|
||||
#endif
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
#if defined(HAVE_XZ) || defined(HAVE_LZ4)
|
||||
const char *i;
|
||||
|
||||
log_set_max_level(LOG_INFO);
|
||||
@ -177,4 +181,7 @@ int main(int argc, char *argv[]) {
|
||||
#endif
|
||||
}
|
||||
return 0;
|
||||
#else
|
||||
return EXIT_TEST_SKIP;
|
||||
#endif
|
||||
}
|
||||
|
@ -54,6 +54,7 @@ typedef int (decompress_sw_t)(const void *src, uint64_t src_size,
|
||||
typedef int (compress_stream_t)(int fdf, int fdt, uint64_t max_bytes);
|
||||
typedef int (decompress_stream_t)(int fdf, int fdt, uint64_t max_size);
|
||||
|
||||
#if defined(HAVE_XZ) || defined(HAVE_LZ4)
|
||||
static void test_compress_decompress(int compression,
|
||||
compress_blob_t compress,
|
||||
decompress_blob_t decompress,
|
||||
@ -203,6 +204,7 @@ static void test_compress_stream(int compression,
|
||||
assert_se(unlink(pattern) == 0);
|
||||
assert_se(unlink(pattern2) == 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LZ4
|
||||
static void test_lz4_decompress_partial(void) {
|
||||
@ -247,6 +249,7 @@ static void test_lz4_decompress_partial(void) {
|
||||
#endif
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
#if defined(HAVE_XZ) || defined(HAVE_LZ4)
|
||||
const char text[] =
|
||||
"text\0foofoofoofoo AAAA aaaaaaaaa ghost busters barbarbar FFF"
|
||||
"foofoofoofoo AAAA aaaaaaaaa ghost busters barbarbar FFF";
|
||||
@ -312,4 +315,7 @@ int main(int argc, char *argv[]) {
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
#else
|
||||
return EXIT_TEST_SKIP;
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user