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

Function AssertFileContents

cpp/src/arrow/io/test_common.cc:43–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41namespace io {
42
43void AssertFileContents(const std::string& path, const std::string& contents) {
44 ASSERT_OK_AND_ASSIGN(auto rf, ReadableFile::Open(path));
45 ASSERT_OK_AND_ASSIGN(int64_t size, rf->GetSize());
46 ASSERT_EQ(size, contents.size());
47
48 ASSERT_OK_AND_ASSIGN(auto actual_data, rf->Read(size));
49 ASSERT_TRUE(actual_data->Equals(Buffer(contents)));
50}
51
52bool FileExists(const std::string& path) { return std::ifstream(path.c_str()).good(); }
53

Callers 2

TEST_FFunction · 0.70
TEST_FFunction · 0.70

Calls 3

BufferClass · 0.70
sizeMethod · 0.45
EqualsMethod · 0.45

Tested by

no test coverage detected