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

Function ReadTestDataFile

snappy_test_data.cc:41–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39namespace snappy {
40
41std::string ReadTestDataFile(const char* base, size_t size_limit) {
42 std::string srcdir;
43 const char* srcdir_env = std::getenv("srcdir"); // This is set by Automake.
44 if (srcdir_env) {
45 srcdir = std::string(srcdir_env) + "/";
46 }
47
48 std::string contents;
49 CHECK_OK(file::GetContents(srcdir + "testdata/" + base, &contents,
50 file::Defaults()));
51 if (size_limit > 0) {
52 contents = contents.substr(0, size_limit);
53 }
54 return contents;
55}
56
57} // namespace snappy

Callers

nothing calls this directly

Calls 1

GetContentsFunction · 0.85

Tested by

no test coverage detected