summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-11-02 23:06:53 -0600
committerGitHub <noreply@github.com>2016-11-02 23:06:53 -0600
commitb2c82a7f2f7c8ae426a9208fb79c5abbd5e3181c (patch)
treeac1e06a266407febfc9c4f108fe79955648d7171 /src
parentb23f2b72bfad53e4420ac661d1771801fc2003f3 (diff)
parent1258f088981ac62efd846de91922eef033302e76 (diff)
Merge pull request #4547 from keszybz/two-testsuite-tweaks
Two testsuite tweaks
Diffstat (limited to 'src')
-rw-r--r--src/journal/test-compress.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/journal/test-compress.c b/src/journal/test-compress.c
index 00e5222a1c..72cadf1771 100644
--- a/src/journal/test-compress.c
+++ b/src/journal/test-compress.c
@@ -247,6 +247,9 @@ int main(int argc, char *argv[]) {
"text\0foofoofoofoo AAAA aaaaaaaaa ghost busters barbarbar FFF"
"foofoofoofoo AAAA aaaaaaaaa ghost busters barbarbar FFF";
+ /* The file to test compression on can be specified as the first argument */
+ const char *srcfile = argc > 1 ? argv[1] : argv[0];
+
char data[512] = "random\0";
char huge[4096*1024];
@@ -275,7 +278,7 @@ int main(int argc, char *argv[]) {
huge, sizeof(huge), true);
test_compress_stream(OBJECT_COMPRESSED_XZ, "xzcat",
- compress_stream_xz, decompress_stream_xz, argv[0]);
+ compress_stream_xz, decompress_stream_xz, srcfile);
#else
log_info("/* XZ test skipped */");
#endif
@@ -297,7 +300,7 @@ int main(int argc, char *argv[]) {
huge, sizeof(huge), true);
test_compress_stream(OBJECT_COMPRESSED_LZ4, "lz4cat",
- compress_stream_lz4, decompress_stream_lz4, argv[0]);
+ compress_stream_lz4, decompress_stream_lz4, srcfile);
test_lz4_decompress_partial();
#else