From: Michal Koutný Date: Fri, 1 May 2020 16:38:10 +0000 (+0200) Subject: test: Fix build with !HAVE_LZ4 && HAVE_XZ X-Git-Tag: v246-rc1~460 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2e4086060b42330c8b6b430227586dbb2d1eddb0;p=thirdparty%2Fsystemd.git test: Fix build with !HAVE_LZ4 && HAVE_XZ HUGE_SIZE was defined inconsistently. > In file included from ../src/basic/alloc-util.h:9, > from ../src/journal/test-compress.c:9: > ../src/journal/test-compress.c: In function ‘main’: > ../src/journal/test-compress.c:280:33: error: ‘HUGE_SIZE’ undeclared (first use in this function) > 280 | assert_se(huge = malloc(HUGE_SIZE)); --- diff --git a/src/journal/test-compress.c b/src/journal/test-compress.c index 6d738f4d66f..0b2898e1099 100644 --- a/src/journal/test-compress.c +++ b/src/journal/test-compress.c @@ -29,6 +29,8 @@ # define LZ4_OK -EPROTONOSUPPORT #endif +#define HUGE_SIZE (4096*1024) + typedef int (compress_blob_t)(const void *src, uint64_t src_size, void *dst, size_t dst_alloc_size, size_t *dst_size); typedef int (decompress_blob_t)(const void *src, uint64_t src_size, @@ -231,7 +233,6 @@ static void test_lz4_decompress_partial(void) { int r; _cleanup_free_ char *huge = NULL; -#define HUGE_SIZE (4096*1024) assert_se(huge = malloc(HUGE_SIZE)); memcpy(huge, "HUGE=", STRLEN("HUGE=")); memset(&huge[STRLEN("HUGE=")], 'x', HUGE_SIZE - STRLEN("HUGE=") - 1);