MCPcopy Create free account
hub / github.com/CobaltFusion/DebugViewPP / ReadTestDataFile

Function ReadTestDataFile

Libraries/snappy/snappy-test.cc:45–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 5

TYPED_TESTFunction · 0.85
BM_UFlatFunction · 0.85
BM_UValidateFunction · 0.85
BM_UIOVecFunction · 0.85
BM_ZFlatFunction · 0.85

Calls 3

GetContentsFunction · 0.85
DefaultsFunction · 0.85
CheckSuccessMethod · 0.80

Tested by

no test coverage detected