MCPcopy Create free account
hub / github.com/Samsung/ONE / read_json

Function read_json

compiler/fme-detect/src/EqualizePatternWrite.test.cpp:30–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28{
29
30Json::Value read_json(const std::string &filename)
31{
32 Json::Value root;
33 std::ifstream ifs(filename);
34
35 // Failed to open cfg file
36 if (not ifs.is_open())
37 throw std::runtime_error("Cannot open config file. " + filename);
38
39 Json::CharReaderBuilder builder;
40 JSONCPP_STRING errs;
41
42 // Failed to parse
43 if (not parseFromStream(builder, ifs, &root, &errs))
44 throw std::runtime_error("Cannot parse config file (json format). " + errs);
45
46 return root;
47}
48
49class EqualizePatternWriteTest : public ::testing::Test
50{

Callers 1

TEST_FFunction · 0.85

Calls 1

parseFromStreamFunction · 0.85

Tested by

no test coverage detected