MCPcopy Create free account
hub / github.com/c-jimenez/open-ocpp / OpenEncodedFile

Function OpenEncodedFile

3rdparty/rapidjson/test/unittest/documenttest.cpp:156–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154}
155
156static FILE* OpenEncodedFile(const char* filename) {
157 const char *paths[] = {
158 "encodings",
159 "bin/encodings",
160 "../bin/encodings",
161 "../../bin/encodings",
162 "../../../bin/encodings"
163 };
164 char buffer[1024];
165 for (size_t i = 0; i < sizeof(paths) / sizeof(paths[0]); i++) {
166 sprintf(buffer, "%s/%s", paths[i], filename);
167 FILE *fp = fopen(buffer, "rb");
168 if (fp)
169 return fp;
170 }
171 return 0;
172}
173
174TEST(Document, Parse_Encoding) {
175 const char* json = " { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3, 4] } ";

Callers 1

TESTFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected