From aa49abdf239bae6065fddd0839ec67a404c9748c Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Mon, 15 Sep 2025 21:15:53 +0200 Subject: Add .clang-format Make it easier to keep a consistent style --- test/decompress.cc | 60 +++++++++++++++++++++++------------------------------- 1 file changed, 26 insertions(+), 34 deletions(-) (limited to 'test/decompress.cc') diff --git a/test/decompress.cc b/test/decompress.cc index 35c4477..df1d08c 100644 --- a/test/decompress.cc +++ b/test/decompress.cc @@ -1,16 +1,14 @@ -#include - #include "decompress.hh" +#include + TEST(z_decompress, empty) { - static const unsigned char data[] = { - 0x1f, 0x8b, 0x08, 0x08, 0x33, 0xd4, 0xbd, 0x68, - 0x02, 0x03, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x00, - 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00 - }; - auto reader = decompress::gzip(io::memory(std::string( - reinterpret_cast(data), sizeof(data)))); + static const unsigned char data[] = {0x1f, 0x8b, 0x08, 0x08, 0x33, 0xd4, 0xbd, + 0x68, 0x02, 0x03, 0x65, 0x6d, 0x70, 0x74, + 0x79, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00}; + auto reader = decompress::gzip(io::memory( + std::string(reinterpret_cast(data), sizeof(data)))); char buf[10]; auto got = reader->read(buf, sizeof(buf)); ASSERT_TRUE(got.has_value()); @@ -19,13 +17,12 @@ TEST(z_decompress, empty) { TEST(z_decompress, hello) { static const unsigned char data[] = { - 0x1f, 0x8b, 0x08, 0x08, 0xf7, 0xd5, 0xbd, 0x68, - 0x02, 0x03, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x00, - 0xf3, 0x48, 0xcd, 0xc9, 0xc9, 0x07, 0x00, 0x82, - 0x89, 0xd1, 0xf7, 0x05, 0x00, 0x00, 0x00, + 0x1f, 0x8b, 0x08, 0x08, 0xf7, 0xd5, 0xbd, 0x68, 0x02, 0x03, 0x68, + 0x65, 0x6c, 0x6c, 0x6f, 0x00, 0xf3, 0x48, 0xcd, 0xc9, 0xc9, 0x07, + 0x00, 0x82, 0x89, 0xd1, 0xf7, 0x05, 0x00, 0x00, 0x00, }; - auto reader = decompress::gzip(io::memory(std::string( - reinterpret_cast(data), sizeof(data)))); + auto reader = decompress::gzip(io::memory( + std::string(reinterpret_cast(data), sizeof(data)))); char buf[10]; auto got = reader->read(buf, sizeof(buf)); ASSERT_TRUE(got.has_value()); @@ -36,13 +33,11 @@ TEST(z_decompress, hello) { TEST(xz_decompress, empty) { static const unsigned char data[] = { - 0xfd, 0x37, 0x7a, 0x58, 0x5a, 0x00, 0x00, 0x04, - 0xe6, 0xd6, 0xb4, 0x46, 0x00, 0x00, 0x00, 0x00, - 0x1c, 0xdf, 0x44, 0x21, 0x1f, 0xb6, 0xf3, 0x7d, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x04, 0x59, 0x5a - }; - auto reader = decompress::xz(io::memory(std::string( - reinterpret_cast(data), sizeof(data)))); + 0xfd, 0x37, 0x7a, 0x58, 0x5a, 0x00, 0x00, 0x04, 0xe6, 0xd6, 0xb4, + 0x46, 0x00, 0x00, 0x00, 0x00, 0x1c, 0xdf, 0x44, 0x21, 0x1f, 0xb6, + 0xf3, 0x7d, 0x01, 0x00, 0x00, 0x00, 0x00, 0x04, 0x59, 0x5a}; + auto reader = decompress::xz(io::memory( + std::string(reinterpret_cast(data), sizeof(data)))); char buf[10]; auto got = reader->read(buf, sizeof(buf)); ASSERT_TRUE(got.has_value()); @@ -51,18 +46,15 @@ TEST(xz_decompress, empty) { TEST(xz_decompress, hello) { static const unsigned char data[] = { - 0xfd, 0x37, 0x7a, 0x58, 0x5a, 0x00, 0x00, 0x04, - 0xe6, 0xd6, 0xb4, 0x46, 0x04, 0xc0, 0x09, 0x05, - 0x21, 0x01, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x76, 0xe9, 0x07, 0x70, - 0x01, 0x00, 0x04, 0x48, 0x65, 0x6c, 0x6c, 0x6f, - 0x00, 0x00, 0x00, 0x00, 0xc8, 0xac, 0x7b, 0xc8, - 0x3b, 0x5c, 0xcf, 0x51, 0x00, 0x01, 0x25, 0x05, - 0x43, 0x91, 0x1f, 0xb8, 0x1f, 0xb6, 0xf3, 0x7d, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x04, 0x59, 0x5a, + 0xfd, 0x37, 0x7a, 0x58, 0x5a, 0x00, 0x00, 0x04, 0xe6, 0xd6, 0xb4, 0x46, + 0x04, 0xc0, 0x09, 0x05, 0x21, 0x01, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x76, 0xe9, 0x07, 0x70, 0x01, 0x00, 0x04, 0x48, + 0x65, 0x6c, 0x6c, 0x6f, 0x00, 0x00, 0x00, 0x00, 0xc8, 0xac, 0x7b, 0xc8, + 0x3b, 0x5c, 0xcf, 0x51, 0x00, 0x01, 0x25, 0x05, 0x43, 0x91, 0x1f, 0xb8, + 0x1f, 0xb6, 0xf3, 0x7d, 0x01, 0x00, 0x00, 0x00, 0x00, 0x04, 0x59, 0x5a, }; - auto reader = decompress::xz(io::memory(std::string( - reinterpret_cast(data), sizeof(data)))); + auto reader = decompress::xz(io::memory( + std::string(reinterpret_cast(data), sizeof(data)))); char buf[10]; auto got = reader->read(buf, sizeof(buf)); ASSERT_TRUE(got.has_value()); -- cgit v1.3