MCPcopy Create free account
hub / github.com/google/snappy / ReadTestDataFile

Function ReadTestDataFile

snappy-test.cc:102–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100namespace snappy {
101
102std::string ReadTestDataFile(const std::string& base, size_t size_limit) {
103 std::string contents;
104 const char* srcdir = getenv("srcdir"); // This is set by Automake.
105 std::string prefix;
106 if (srcdir) {
107 prefix = std::string(srcdir) + "/";
108 }
109 file::GetContents(prefix + "testdata/" + base, &contents, file::Defaults()
110 ).ok();
111 if (size_limit > 0) {
112 contents = contents.substr(0, size_limit);
113 }
114 return contents;
115}
116
117std::string StrFormat(const char* format, ...) {
118 char buffer[4096];

Callers 10

BM_UFlatFunction · 0.70
SourceFilesMethod · 0.70
BM_UValidateFunction · 0.70
BM_UIOVecSourceFunction · 0.70
BM_UIOVecSinkFunction · 0.70
BM_UFlatSinkFunction · 0.70
BM_ZFlatFunction · 0.70
BM_ZFlatAllFunction · 0.70
TESTFunction · 0.70

Calls 2

GetContentsFunction · 0.85
okMethod · 0.80

Tested by

no test coverage detected