1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-07 08:05:38 +02:00

[contrib][linux-kernel] Add standard warnings and -Werror to CI

Test the kernel build with the standard warnings enabled so that we
don't miss issues like fixed in PR #2802.

Stacked on top of PR #2802 so CI passes, so it includes the fix. But, I
won't merge until it is merged, so @solbjorn gets the credit for the
fix.
This commit is contained in:
Nick Terrell
2021-09-24 14:46:45 -07:00
parent 32a8443b5c
commit b10085d97d
6 changed files with 57 additions and 39 deletions

View File

@ -28,17 +28,19 @@ static const char kEmptyZstdFrame[] = {
0x28, 0xb5, 0x2f, 0xfd, 0x24, 0x00, 0x01, 0x00, 0x00, 0x99, 0xe9, 0xd8, 0x51
};
static void test_decompress_unzstd() {
static void test_decompress_unzstd(void) {
fprintf(stderr, "Testing decompress unzstd... ");
{
size_t const wkspSize = zstd_dctx_workspace_bound();
void* wksp = malloc(wkspSize);
CONTROL(wksp != NULL);
ZSTD_DCtx* dctx = zstd_init_dctx(wksp, wkspSize);
CONTROL(wksp != NULL);
CONTROL(dctx != NULL);
size_t const dSize = zstd_decompress_dctx(dctx, NULL, 0, kEmptyZstdFrame, sizeof(kEmptyZstdFrame));
CONTROL(!zstd_is_error(dSize));
CONTROL(dSize == 0);
{
size_t const dSize = zstd_decompress_dctx(dctx, NULL, 0, kEmptyZstdFrame, sizeof(kEmptyZstdFrame));
CONTROL(!zstd_is_error(dSize));
CONTROL(dSize == 0);
}
free(wksp);
}
fprintf(stderr, "Ok\n");