Files
nixpkgs/pkgs/by-name/li/liblzf/lib_test.c
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

34 lines
725 B
C

#include "lzf.h"
#include <stdio.h>
#include <string.h>
int main(void) {
const char *test = "liblzf test for nixpkgs, nixpkgs for test liblzf";
const size_t ilen = strlen(test) + 1;
printf("Test string length: %zu\n", ilen);
char compressed[100];
char decompressed[100];
unsigned int clen =
lzf_compress(test, ilen, compressed, sizeof(compressed));
if (!clen)
return 1;
printf("Compressed length: %d\n", clen);
unsigned int dlen =
lzf_decompress(compressed, clen, decompressed, sizeof(decompressed));
if (!dlen)
return 2;
if (strcmp(test, decompressed) != 0) {
printf("Strings don't match!\n");
return 3;
}
printf("Strings match, tests passed!\n");
return 0;
}