Skip to content

Commit

Permalink
test decompress with an invalid header (#126)
Browse files Browse the repository at this point in the history
Change-Id: I38d3105028247c4da00e9061dc5a806955a79d4e
  • Loading branch information
garymm committed Jan 16, 2024
1 parent 3cc6b47 commit 69f50ff
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/test/decompress_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ auto main(int, char* argv[]) -> int
<< "got type: " << static_cast<int>(header->type);
};

test("decompress invalid header") = [] -> void {
const auto result =
decompress(std::span<const std::byte>{}, std::span<std::byte>{});
expect(result.error() == DecompressError::InvalidBlockHeader);
};

test("no compression") = [] {
constexpr auto compressed = huffman::byte_array(
0b000, // no compression, not final
Expand Down

0 comments on commit 69f50ff

Please sign in to comment.