MCPcopy Create free account
hub / github.com/apache/arrow / AssertGetObject

Function AssertGetObject

cpp/src/arrow/filesystem/s3fs_test.cc:253–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251};
252
253void AssertGetObject(Aws::S3::Model::GetObjectResult& result,
254 const std::string& expected) {
255 auto length = static_cast<int64_t>(expected.length());
256 ASSERT_EQ(result.GetContentLength(), length);
257 auto& stream = result.GetBody();
258 std::string actual;
259 actual.resize(length + 1);
260 stream.read(&actual[0], length + 1);
261 ASSERT_EQ(stream.gcount(), length); // EOF was reached before length + 1
262 actual.resize(length);
263 ASSERT_EQ(actual.size(), expected.size());
264 ASSERT_TRUE(actual == expected); // Avoid ASSERT_EQ on large data
265}
266
267void AssertObjectContents(Aws::S3::S3Client* client, const std::string& bucket,
268 const std::string& key, const std::string& expected) {

Callers 1

AssertObjectContentsFunction · 0.85

Calls 5

resizeMethod · 0.80
lengthMethod · 0.45
GetContentLengthMethod · 0.45
readMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected