mirror of
https://github.com/facebook/zstd.git
synced 2025-03-07 01:10:04 +02:00
Add test to validate patch
This commit is contained in:
parent
18d3a97d43
commit
91ffc8d256
@ -130,12 +130,28 @@ static int testStreamingAPI(void)
|
||||
return error_code;
|
||||
}
|
||||
|
||||
static int testFrameDecoding(void)
|
||||
{
|
||||
if (ZSTD_decompressBound(COMPRESSED, COMPRESSED_SIZE) != ZSTD_CONTENTSIZE_ERROR) {
|
||||
DISPLAY("ERROR: ZSTD_decompressBound: Expected to receive ZSTD_CONTENTSIZE_ERROR\n");
|
||||
return 1;
|
||||
}
|
||||
if (ZSTD_findFrameCompressedSize(COMPRESSED) != COMPRESSED_SIZE) {
|
||||
DISPLAY("ERROR: ZSTD_findFrameCompressedSize: Expected to receive %d\n", COMPRESSED_SIZE);
|
||||
return 1;
|
||||
}
|
||||
DISPLAY("Frame Decoding OK\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
{ int const ret = testSimpleAPI();
|
||||
if (ret) return ret; }
|
||||
{ int const ret = testStreamingAPI();
|
||||
if (ret) return ret; }
|
||||
{ int const ret = testFrameDecoding();
|
||||
if (ret) return ret; }
|
||||
|
||||
DISPLAY("OK\n");
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user