56 {
57 PerfTest::SetUp();
58
59 const char* filenames[] = {
60 "additionalItems.json",
61 "additionalProperties.json",
62 "allOf.json",
63 "anyOf.json",
64 "default.json",
65 "definitions.json",
66 "dependencies.json",
67 "enum.json",
68 "items.json",
69 "maximum.json",
70 "maxItems.json",
71 "maxLength.json",
72 "maxProperties.json",
73 "minimum.json",
74 "minItems.json",
75 "minLength.json",
76 "minProperties.json",
77 "multipleOf.json",
78 "not.json",
79 "oneOf.json",
80 "pattern.json",
81 "patternProperties.json",
82 "properties.json",
83 "ref.json",
84 "refRemote.json",
85 "required.json",
86 "type.json",
87 "uniqueItems.json"
88 };
89
90 char jsonBuffer[65536];
92
93 for (
size_t i = 0; i <
ARRAY_SIZE(filenames); i++) {
94 char filename[FILENAME_MAX];
95 sprintf(filename, "jsonschema/tests/draft4/%s", filenames[i]);
96 char* json = ReadFile(filename, jsonAllocator);
97 if (!json) {
98 printf(
"json test suite file %s not found", filename);
99 return;
100 }
101
104 if (
d.HasParseError()) {
105 printf(
"json test suite file %s has parse error", filename);
106 return;
107 }
108
110 std::string schemaDescription = (*schemaItr)["description"].GetString();
111 if (IsExcludeTestSuite(schemaDescription))
112 continue;
113
114 TestSuite* ts = new TestSuite;
116
117 const Value& tests = (*schemaItr)[
"tests"];
119 if (IsExcludeTest(schemaDescription + ", " + (*testItr)["description"].GetString()))
120 continue;
121
124 ts->tests.push_back(d2);
125 }
127 }
128 }
129 }
Allocator & GetAllocator()
Get the allocator of this document.
Represents a JSON value. Use Value for UTF8 encoding and default allocator.
Default memory allocator used by the parser and DOM.
GenericDocument< UTF8<> > Document
GenericDocument with UTF8 encoding.
GenericSchemaDocument< Value, CrtAllocator > SchemaDocument
LOGGING_API void printf(Category category, const char *format,...)