Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
schematest.cpp File Reference
#include "perftest.h"
#include "rapidjson/schema.h"
#include <ctime>
#include <string>
#include <vector>
Include dependency graph for schematest.cpp:

Go to the source code of this file.

Classes

class  Schema
 
struct  Schema::TestSuite
 

Macros

#define ARRAY_SIZE(a)
 

Functions

 TEST_F (Schema, TestSuite)
 

Macro Definition Documentation

◆ ARRAY_SIZE

#define ARRAY_SIZE ( a)
Value:
sizeof(a) / sizeof(a[0])
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181

Definition at line 10 of file schematest.cpp.

Function Documentation

◆ TEST_F()

TEST_F ( Schema ,
TestSuite  )

Definition at line 198 of file schematest.cpp.

198 {
199 char validatorBuffer[65536];
200 MemoryPoolAllocator<> validatorAllocator(validatorBuffer, sizeof(validatorBuffer));
201
202 const int trialCount = 100000;
203 int testCount = 0;
204 clock_t start = clock();
205 for (int i = 0; i < trialCount; i++) {
206 for (TestSuiteList::const_iterator itr = testSuites.begin(); itr != testSuites.end(); ++itr) {
207 const TestSuite& ts = **itr;
209 for (DocumentList::const_iterator testItr = ts.tests.begin(); testItr != ts.tests.end(); ++testItr) {
210 validator.Reset();
211 (*testItr)->Accept(validator);
212 testCount++;
213 }
214 validatorAllocator.Clear();
215 }
216 }
217 clock_t end = clock();
218 double duration = double(end - start) / CLOCKS_PER_SEC;
219 printf("%d trials in %f s -> %f trials per sec\n", trialCount, duration, trialCount / duration);
220 printf("%d tests per trial\n", testCount / trialCount);
221}
JSON Schema Validator.
Definition schema.h:1767
Default memory allocator used by the parser and DOM.
Definition allocators.h:115
LOGGING_API void printf(Category category, const char *format,...)
Definition Logging.cpp:30
Here is the call graph for this function: