summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Koutný <mkoutny@suse.com>2020-05-01 18:38:10 +0200
committerTopi Miettinen <topimiettinen@users.noreply.github.com>2020-05-02 20:04:36 +0000
commit2e4086060b42330c8b6b430227586dbb2d1eddb0 (patch)
tree38aa838782c8abc0eb3ab33205476913b1ec2151
parent9494b39dac37894628cf5ef405e6bbc18f69bba9 (diff)
downloadsystemd-2e4086060b42330c8b6b430227586dbb2d1eddb0.tar.gz
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));
-rw-r--r--src/journal/test-compress.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/journal/test-compress.c b/src/journal/test-compress.c
index 6d738f4d66..0b2898e109 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);