| 49 | } |
| 50 | |
| 51 | static std::string readFile(std::string filename) { |
| 52 | #ifdef _WIN32 |
| 53 | std::string const separator("\\"); |
| 54 | #else |
| 55 | std::string const separator("/"); |
| 56 | #endif |
| 57 | filename = "tests" + separator + "jsonSample" + separator + filename; |
| 58 | |
| 59 | for (std::size_t i = 0; i < 3; ++i) { |
| 60 | try { |
| 61 | return tryReadFile(filename); |
| 62 | } catch (...) { |
| 63 | filename = ".." + separator + filename; |
| 64 | } |
| 65 | } |
| 66 | throw "cannot open input file"; |
| 67 | } |
| 68 | |
| 69 | static bool parseFile(std::string const& filename) { |
| 70 | std::string const data = readFile(filename); |
no test coverage detected