Skip to content

Commit 134c140

Browse files
committed
Fix PartiallyConsumedStreamChecksumReuse test
1 parent 3908edf commit 134c140

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/aws-cpp-sdk-s3-unit-tests/S3UnitTests.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,10 @@ TEST_F(S3UnitTest, PartiallyConsumedStreamChecksumReuse) {
637637
auto successResponse = Aws::MakeShared<Standard::StandardHttpResponse>(ALLOCATION_TAG, errorResponseStream);
638638
successResponse->SetResponseCode(HttpResponseCode::OK);
639639
_mockHttpClient->AddResponseToReturn(
640-
successResponse, [](IOStream&) -> void {}, [](const std::shared_ptr<Aws::Http::HttpRequest>&) -> void {});
640+
successResponse, [](IOStream& stream) -> void {EXPECT_EQ(stream.tellg(), 0);}, [](const std::shared_ptr<Aws::Http::HttpRequest>& request) -> void {
641+
Aws::Array<char, 9216> tempBuffer;
642+
request->GetContentBody()->read(tempBuffer.data(), 9216);
643+
});
641644

642645
// The top level test has a no retry policy so we have to create one that retries
643646
const AWSCredentials credentials{"mock", "credentials"};
@@ -650,8 +653,6 @@ TEST_F(S3UnitTest, PartiallyConsumedStreamChecksumReuse) {
650653
const auto response = clientWithRetries.PutObject(request);
651654
AWS_EXPECT_SUCCESS(response);
652655

653-
EXPECT_EQ(_mockHttpClient->GetAllRequestsMade().size(), 2UL);
654-
655656
Aws::Utils::Crypto::CRC64 crc64Hash{};
656657
const auto expectedChecksum = crc64Hash.Calculate(bodyString);
657658
EXPECT_TRUE(expectedChecksum.IsSuccess());

0 commit comments

Comments
 (0)