@@ -688,7 +688,8 @@ TEST(ParseAcceptEncoding2, AcceptEncoding) {
688688
689689TEST (ParseAcceptEncoding3, AcceptEncoding) {
690690 Request req;
691- req.set_header (" Accept-Encoding" , " br;q=1.0, gzip;q=0.8, zstd;q=0.8, *;q=0.1" );
691+ req.set_header (" Accept-Encoding" ,
692+ " br;q=1.0, gzip;q=0.8, zstd;q=0.8, *;q=0.1" );
692693
693694 Response res;
694695 res.set_header (" Content-Type" , " text/plain" );
@@ -3011,7 +3012,8 @@ class ServerTest : public ::testing::Test {
30113012 const httplib::ContentReader &) {
30123013 res.set_content (" ok" , " text/plain" );
30133014 })
3014- #if defined(CPPHTTPLIB_ZLIB_SUPPORT) || defined(CPPHTTPLIB_BROTLI_SUPPORT) || defined(CPPHTTPLIB_ZSTD_SUPPORT)
3015+ #if defined(CPPHTTPLIB_ZLIB_SUPPORT) || defined(CPPHTTPLIB_BROTLI_SUPPORT) || \
3016+ defined (CPPHTTPLIB_ZSTD_SUPPORT)
30153017 .Get (" /compress" ,
30163018 [&](const Request & /* req*/ , Response &res) {
30173019 res.set_content (
@@ -4991,20 +4993,19 @@ TEST_F(ServerTest, ZstdWithoutDecompressing) {
49914993 cli_.set_decompress (false );
49924994 auto res = cli_.Get (" /compress" , headers);
49934995
4994- unsigned char compressed[26 ] = {
4995- 0x28 , 0xb5 , 0x2f , 0xfd , 0x20 , 0x64 , 0x8d , 0x00 ,
4996- 0x00 , 0x50 , 0x31 , 0x32 , 0x33 , 0x34 , 0x35 , 0x36 ,
4997- 0x37 , 0x38 , 0x39 , 0x30 , 0x01 , 0x00 , 0xd7 , 0xa9 ,
4998- 0x20 , 0x01
4999- };
4996+ unsigned char compressed[26 ] = {0x28 , 0xb5 , 0x2f , 0xfd , 0x20 , 0x64 , 0x8d ,
4997+ 0x00 , 0x00 , 0x50 , 0x31 , 0x32 , 0x33 , 0x34 ,
4998+ 0x35 , 0x36 , 0x37 , 0x38 , 0x39 , 0x30 , 0x01 ,
4999+ 0x00 , 0xd7 , 0xa9 , 0x20 , 0x01 };
50005000
50015001 ASSERT_TRUE (res);
50025002 EXPECT_EQ (" zstd" , res->get_header_value (" Content-Encoding" ));
50035003 EXPECT_EQ (" text/plain" , res->get_header_value (" Content-Type" ));
50045004 EXPECT_EQ (" 26" , res->get_header_value (" Content-Length" ));
50055005 EXPECT_EQ (StatusCode::OK_200, res->status );
50065006 ASSERT_EQ (26U , res->body .size ());
5007- EXPECT_TRUE (std::memcmp (compressed, res->body .data (), sizeof (compressed)) == 0 );
5007+ EXPECT_TRUE (std::memcmp (compressed, res->body .data (), sizeof (compressed)) ==
5008+ 0 );
50085009}
50095010
50105011TEST_F (ServerTest, ZstdWithContentReceiverWithoutAcceptEncoding) {
@@ -5074,7 +5075,6 @@ TEST_F(ServerTest, MultipartFormDataZstd) {
50745075 Headers headers;
50755076 headers.emplace (" Accept-Encoding" , " zstd" );
50765077
5077-
50785078 cli_.set_compress (true );
50795079 auto res = cli_.Post (" /compress-multipart" , headers, items);
50805080
@@ -5085,7 +5085,7 @@ TEST_F(ServerTest, MultipartFormDataZstd) {
50855085TEST_F (ServerTest, PutWithContentProviderWithZstd) {
50865086 Headers headers;
50875087 headers.emplace (" Accept-Encoding" , " zstd" );
5088-
5088+
50895089 cli_.set_compress (true );
50905090 auto res = cli_.Put (
50915091 " /put" , headers, 3 ,
@@ -5148,12 +5148,10 @@ TEST(ZstdDecompressor, ChunkedDecompression) {
51485148
51495149TEST (ZstdDecompressor, Decompress) {
51505150 std::string original_text = " Compressed with ZSTD" ;
5151- unsigned char data[29 ] = {
5152- 0x28 , 0xb5 , 0x2f , 0xfd , 0x20 , 0x14 , 0xa1 , 0x00 ,
5153- 0x00 , 0x43 , 0x6f , 0x6d , 0x70 , 0x72 , 0x65 , 0x73 ,
5154- 0x73 , 0x65 , 0x64 , 0x20 , 0x77 , 0x69 , 0x74 , 0x68 ,
5155- 0x20 , 0x5a , 0x53 , 0x54 , 0x44
5156- };
5151+ unsigned char data[29 ] = {0x28 , 0xb5 , 0x2f , 0xfd , 0x20 , 0x14 , 0xa1 , 0x00 ,
5152+ 0x00 , 0x43 , 0x6f , 0x6d , 0x70 , 0x72 , 0x65 , 0x73 ,
5153+ 0x73 , 0x65 , 0x64 , 0x20 , 0x77 , 0x69 , 0x74 , 0x68 ,
5154+ 0x20 , 0x5a , 0x53 , 0x54 , 0x44 };
51575155 std::string compressed_data (data, data + sizeof (data) / sizeof (data[0 ]));
51585156
51595157 std::string decompressed_data;
0 commit comments