Skip to content

Commit 86b89b4

Browse files
committed
[TEST] Build the one byte body the way the rest of the file does
The case filled its body with an explicit uint8_t, which made the file need a fixed-width integer header. IWYU asks for <stdint.h> there and modernize-deprecated-headers, which this repo enables, rejects that header and wants <cstdint>; the file cannot satisfy both while the type is spelled out. GzipIncompressibleData a few lines below already sizes its body with http_client::Body body(original_size), and only the length matters here: one byte is too small to hold a gzip header, which is what makes the deflate fail. Sizing the body the same way needs no element type and no cast, and leaves no fixed-width type in the file. Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com>
1 parent 6b24526 commit 86b89b4

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎ext/test/http/curl_http_test.cc‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
#include <curl/curlver.h>
5-
#include <stdint.h>
65
#include "gtest/gtest.h"
76

87
#ifdef ENABLE_OTLP_RETRY_PREVIEW
@@ -1012,7 +1011,7 @@ TEST_F(BasicCurlHttpTests, AFailedCompressionStopsTheRequest)
10121011
request->SetUri("post/");
10131012
request->SetMethod(http_client::Method::Post);
10141013

1015-
http_client::Body body(1, static_cast<uint8_t>('a'));
1014+
http_client::Body body(1);
10161015
request->SetBody(body);
10171016
request->AddHeader("Content-Type", "text/plain");
10181017
request->SetCompression(opentelemetry::ext::http::client::Compression::kGzip);

0 commit comments

Comments
 (0)