mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:37:46 +00:00
Tests: Move LibCompress tests to Tests/LibCompress
This commit is contained in:
parent
597de3356f
commit
070cba9b0d
6 changed files with 1 additions and 2 deletions
25
Tests/LibCompress/TestZlib.cpp
Normal file
25
Tests/LibCompress/TestZlib.cpp
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright (c) 2020-2021, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibTest/TestCase.h>
|
||||
|
||||
#include <AK/Array.h>
|
||||
#include <LibCompress/Zlib.h>
|
||||
|
||||
TEST_CASE(zlib_decompress_simple)
|
||||
{
|
||||
const Array<u8, 40> compressed {
|
||||
0x78, 0x01, 0x01, 0x1D, 0x00, 0xE2, 0xFF, 0x54, 0x68, 0x69, 0x73, 0x20,
|
||||
0x69, 0x73, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6D, 0x70, 0x6C, 0x65, 0x20,
|
||||
0x74, 0x65, 0x78, 0x74, 0x20, 0x66, 0x69, 0x6C, 0x65, 0x20, 0x3A, 0x29,
|
||||
0x99, 0x5E, 0x09, 0xE8
|
||||
};
|
||||
|
||||
const u8 uncompressed[] = "This is a simple text file :)";
|
||||
|
||||
const auto decompressed = Compress::Zlib::decompress_all(compressed);
|
||||
EXPECT(decompressed.value().bytes() == (ReadonlyBytes { uncompressed, sizeof(uncompressed) - 1 }));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue