summaryrefslogtreecommitdiff
path: root/src/journal/test-compress-benchmark.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-12-23 21:31:07 +0100
committerLennart Poettering <lennart@poettering.net>2015-12-23 21:31:07 +0100
commit838c669055ddbbd04998ffc345a81f6fddbb9cfe (patch)
tree1115907b1d2155b6427a3cc01db333ab8d44dcd6 /src/journal/test-compress-benchmark.c
parentd6ef10fadfe757c8f0a5664097978b4f4d0f430e (diff)
parentae5e1b19e78ed85259868d12ca8042fd2e87d423 (diff)
Merge pull request #2158 from keszybz/journal-decompression
Journal decompression fixes
Diffstat (limited to 'src/journal/test-compress-benchmark.c')
-rw-r--r--src/journal/test-compress-benchmark.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/journal/test-compress-benchmark.c b/src/journal/test-compress-benchmark.c
index 93ea9c6318..baed0d82a4 100644
--- a/src/journal/test-compress-benchmark.c
+++ b/src/journal/test-compress-benchmark.c
@@ -27,7 +27,8 @@
#include "string-util.h"
#include "util.h"
-typedef int (compress_t)(const void *src, uint64_t src_size, void *dst, size_t *dst_size);
+typedef int (compress_t)(const void *src, uint64_t src_size, void *dst,
+ size_t dst_alloc_size, size_t *dst_size);
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);
@@ -111,8 +112,8 @@ static void test_compress_decompress(const char* label, const char* type,
memzero(buf, MIN(size + 1000, MAX_SIZE));
- r = compress(text, size, buf, &j);
- /* assume compression must be successful except for small inputs */
+ r = compress(text, size, buf, size, &j);
+ /* assume compression must be successful except for small or random inputs */
assert_se(r == 0 || (size < 2048 && r == -ENOBUFS) || streq(type, "random"));
/* check for overwrites */