28 const char *paths[] = {
30 "bin/data/sample.json",
31 "../bin/data/sample.json",
32 "../../bin/data/sample.json",
33 "../../../bin/data/sample.json"
36 for (
size_t i = 0; i <
sizeof(paths) /
sizeof(paths[0]); i++) {
37 fp = fopen(paths[i],
"rb");
45 fseek(fp, 0, SEEK_END);
46 length_ =
static_cast<size_t>(ftell(fp));
47 fseek(fp, 0, SEEK_SET);
50 json_[readLength] =
'\0';
53 const char *abcde_paths[] = {
56 "../bin/data/abcde.txt",
57 "../../bin/data/abcde.txt",
58 "../../../bin/data/abcde.txt"
61 for (
size_t i = 0; i <
sizeof(abcde_paths) /
sizeof(abcde_paths[0]); i++) {
62 fp = fopen(abcde_paths[i],
"rb");
91 FILE *fp = fopen(filename_,
"rb");
96 for (
size_t i = 0; i < length_; i++) {
109 FILE *fp = fopen(abcde_,
"rb");
114 const char* c =
s.Peek4();
115 for (
int i = 0; i < 4; i++)
119 for (
int i = 0; i < 5; i++) {
133 char filename[L_tmpnam];
138 for (
size_t i = 0; i < length_; i++)
144 fp = fopen(filename,
"rb");
147 for (
size_t i = 0; i < length_; i++)
File byte stream for input using fread().
virtual ~FileStreamTest()
Wrapper of C file stream for output using fwrite().
#define TEST_F(test_fixture, test_name)
#define EXPECT_EQ(val1, val2)
#define ASSERT_TRUE(condition)
FILE * TempFile(char *filename)