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

Function AssertGetObject

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

Source from the content-addressed store, hash-verified

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