Search sample data in more folders for perftest
This commit is contained in:
parent
22021d6622
commit
556d154bed
@ -71,9 +71,20 @@ public:
|
|||||||
PerfTest() : filename_(), json_(), length_(), whitespace_(), whitespace_length_() {}
|
PerfTest() : filename_(), json_(), length_(), whitespace_(), whitespace_length_() {}
|
||||||
|
|
||||||
virtual void SetUp() {
|
virtual void SetUp() {
|
||||||
FILE *fp = fopen(filename_ = "data/sample.json", "rb");
|
|
||||||
if (!fp)
|
const char *paths[] = {
|
||||||
fp = fopen(filename_ = "../../bin/data/sample.json", "rb");
|
"data/sample.json",
|
||||||
|
"bin/data/sample.json",
|
||||||
|
"../bin/data/sample.json",
|
||||||
|
"../../bin/data/sample.json",
|
||||||
|
"../../../bin/data/sample.json"
|
||||||
|
};
|
||||||
|
FILE *fp = 0;
|
||||||
|
for (size_t i = 0; i < sizeof(paths) / sizeof(paths[0]); i++) {
|
||||||
|
fp = fopen(paths[i], "rb");
|
||||||
|
if (fp)
|
||||||
|
break;
|
||||||
|
}
|
||||||
ASSERT_TRUE(fp != 0);
|
ASSERT_TRUE(fp != 0);
|
||||||
|
|
||||||
fseek(fp, 0, SEEK_END);
|
fseek(fp, 0, SEEK_END);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user