MCPcopy Create free account
hub / github.com/apache/nifi-minifi-cpp / testFile

Method testFile

extensions/sftp/tests/PutSFTPTests.cpp:142–154  ·  view source on GitHub ↗

Test target file

Source from the content-addressed store, hash-verified

140
141 // Test target file
142 void testFile(const std::string& relative_path, const std::string& expected_content) {
143 std::stringstream resultFile;
144 resultFile << dst_dir << "/vfs/" << relative_path;
145 std::ifstream file(resultFile.str());
146 REQUIRE(true == file.good());
147 std::stringstream content;
148 std::vector<char> buffer(1024U);
149 while (file) {
150 file.read(buffer.data(), buffer.size());
151 content << std::string(buffer.data(), file.gcount());
152 }
153 REQUIRE(expected_content == content.str());
154 }
155
156 void testFileNotExists(const std::string& relative_path) {
157 std::stringstream resultFile;

Callers

nothing calls this directly

Calls 2

readMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected