MCPcopy Create free account
hub / github.com/Tencent/rapidjson / OpenEncodedFile

Function OpenEncodedFile

test/unittest/documenttest.cpp:147–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145}
146
147static FILE* OpenEncodedFile(const char* filename) {
148 const char *paths[] = {
149 "encodings",
150 "bin/encodings",
151 "../bin/encodings",
152 "../../bin/encodings",
153 "../../../bin/encodings"
154 };
155 char buffer[1024];
156 for (size_t i = 0; i < sizeof(paths) / sizeof(paths[0]); i++) {
157 sprintf(buffer, "%s/%s", paths[i], filename);
158 FILE *fp = fopen(buffer, "rb");
159 if (fp)
160 return fp;
161 }
162 return 0;
163}
164
165TEST(Document, Parse_Encoding) {
166 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