MCPcopy Create free account
hub / github.com/bytedance/terarkdb / WriteToNewFile

Method WriteToNewFile

util/testutil.h:631–643  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

629 const std::string& GetContent(const std::string& f) { return files_[f]; }
630
631 const Status WriteToNewFile(const std::string& file_name,
632 const std::string& content) {
633 std::unique_ptr<WritableFile> r;
634 auto s = NewWritableFile(file_name, &r, EnvOptions());
635 if (!s.ok()) {
636 return s;
637 }
638 r->Append(content);
639 r->Flush();
640 r->Close();
641 assert(files_[file_name] == content);
642 return Status::OK();
643 }
644
645 // The following text is boilerplate that forwards all methods to target()
646 Status NewSequentialFile(const std::string& f,

Callers 1

TEST_FFunction · 0.80

Calls 7

NewWritableFileFunction · 0.85
OKFunction · 0.85
EnvOptionsClass · 0.50
okMethod · 0.45
AppendMethod · 0.45
FlushMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected