MCPcopy Create free account
hub / github.com/TuGraph-family/tugraph-db / read_code

Function read_code

test/test_cpp_procedure.cpp:104–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104void read_code(const std::string& code_path, std::string& code) {
105 auto& fs = fma_common::FileSystem::GetFileSystem(code_path);
106 if (fs.FileExists(code_path)) {
107 fma_common::InputFmaStream ifs(code_path, 0);
108 size_t sz = ifs.Size();
109 code.resize(sz);
110 size_t ssz = ifs.Read(&code[0], sz);
111 if (ssz != sz) {
112 UT_ERR() << "Failed to read plugin file " << code_path;
113 }
114 } else {
115 UT_ERR() << "Failed to find plugin file " << code_path;
116 }
117}
118
119TEST_F(TestCppPlugin, CppPlugin) {
120 using namespace fma_common;

Callers 3

WriteEchoPluginFunction · 0.85
WriteSleepPluginFunction · 0.85
TEST_FFunction · 0.85

Calls 4

resizeMethod · 0.80
FileExistsMethod · 0.45
SizeMethod · 0.45
ReadMethod · 0.45

Tested by

no test coverage detected