test-compress.c revision ae5e1b19e78ed85259868d12ca8042fd2e87d423
4ad490007b70e6ac18d3cb04fa2ed92eba1451faLennart Poettering This file is part of systemd
4ad490007b70e6ac18d3cb04fa2ed92eba1451faLennart Poettering Copyright 2014 Ronny Chevalier
4ad490007b70e6ac18d3cb04fa2ed92eba1451faLennart Poettering systemd is free software; you can redistribute it and/or modify it
4ad490007b70e6ac18d3cb04fa2ed92eba1451faLennart Poettering under the terms of the GNU Lesser General Public License as published by
4ad490007b70e6ac18d3cb04fa2ed92eba1451faLennart Poettering the Free Software Foundation; either version 2.1 of the License, or
4ad490007b70e6ac18d3cb04fa2ed92eba1451faLennart Poettering (at your option) any later version.
4ad490007b70e6ac18d3cb04fa2ed92eba1451faLennart Poettering systemd is distributed in the hope that it will be useful, but
4ad490007b70e6ac18d3cb04fa2ed92eba1451faLennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
4ad490007b70e6ac18d3cb04fa2ed92eba1451faLennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4ad490007b70e6ac18d3cb04fa2ed92eba1451faLennart Poettering Lesser General Public License for more details.
4ad490007b70e6ac18d3cb04fa2ed92eba1451faLennart Poettering You should have received a copy of the GNU Lesser General Public License
4ad490007b70e6ac18d3cb04fa2ed92eba1451faLennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
4ad490007b70e6ac18d3cb04fa2ed92eba1451faLennart Poetteringtypedef int (compress_blob_t)(const void *src, uint64_t src_size,
const char *data,
bool may_fail) {
if (r == -ENOBUFS) {
assert_se(r == 0);
assert_se(r == 0);
assert_se(r < 0);
assert_se(r < 0);
assert_se(r < 0);
const char *data,
bool may_fail) {
char *compressed;
if (r == -ENOBUFS) {
assert(r == 0);
assert_se(r == 0);
assert_se(r > 0);
assert_se(r == 0);
assert_se(r == 0);
assert_se(r > 0);
assert_se(r == 0);
assert_se(r > 0);
const char* cat,
const char *srcfile) {
if (cat) {
assert_se(r == 0);
#ifdef HAVE_LZ4
static void test_lz4_decompress_partial(void) {
assert_se(r >= 0);
compressed = r;
assert_se(r >= 0);
assert_se(r >= 0);
assert_se(r < 0);
const char text[] =
#ifdef HAVE_XZ
#ifdef HAVE_LZ4