49 {
50 PerfTest::SetUp();
51
52 const char* filenames[] = {
53 "additionalItems.json",
54 "additionalProperties.json",
55 "allOf.json",
56 "anyOf.json",
57 "default.json",
58 "definitions.json",
59 "dependencies.json",
60 "enum.json",
61 "items.json",
62 "maximum.json",
63 "maxItems.json",
64 "maxLength.json",
65 "maxProperties.json",
66 "minimum.json",
67 "minItems.json",
68 "minLength.json",
69 "minProperties.json",
70 "multipleOf.json",
71 "not.json",
72 "oneOf.json",
73 "pattern.json",
74 "patternProperties.json",
75 "properties.json",
76 "ref.json",
77 "refRemote.json",
78 "required.json",
79 "type.json",
80 "uniqueItems.json"
81 };
82
83 char jsonBuffer[65536];
84 MemoryPoolAllocator<> jsonAllocator(jsonBuffer, sizeof(jsonBuffer));
85
86 for (
size_t i = 0; i <
ARRAY_SIZE(filenames); i++) {
87 char filename[FILENAME_MAX];
88 sprintf(filename, "jsonschema/tests/draft4/%s", filenames[i]);
89 char*
json = ReadFile(filename, jsonAllocator);
91 printf("json test suite file %s not found", filename);
92 return;
93 }
94
98 printf("json test suite file %s has parse error", filename);
99 return;
100 }
101
103 std::string schemaDescription = (*schemaItr)["description"].GetString();
104 if (IsExcludeTestSuite(schemaDescription))
105 continue;
106
109
110 const Value& tests = (*schemaItr)[
"tests"];
112 if (IsExcludeTest(schemaDescription + ", " + (*testItr)["description"].GetString()))
113 continue;
114
117 ts->tests.push_back(d2);
118 }
120 }
121 }
122 }
Allocator & GetAllocator()
Get the allocator of this document.
bool HasParseError() const
Whether a parse error has occurred in the last parsing.
GenericDocument & Parse(const typename SourceEncoding::Ch *str)
Parse JSON text from a read-only string (with Encoding conversion).
const GenericValue * ConstValueIterator
GenericValue< UTF8<> > Value
GenericValue with UTF8 encoding.
GenericDocument< UTF8<> > Document
GenericDocument with UTF8 encoding.
GenericSchemaDocument< Value, CrtAllocator > SchemaDocument