add dump of unexpected schema errors in schematest.cpp
This commit is contained in:
parent
89f6717f0b
commit
ecb8d9e3a0
@ -118,6 +118,12 @@ TEST(SchemaValidator, Hasher) {
|
|||||||
#define VALIDATE_(schema, json, expected, expected2) \
|
#define VALIDATE_(schema, json, expected, expected2) \
|
||||||
{\
|
{\
|
||||||
EXPECT_TRUE(expected2 == schema.GetError().ObjectEmpty());\
|
EXPECT_TRUE(expected2 == schema.GetError().ObjectEmpty());\
|
||||||
|
if (expected2 && !schema.GetError().ObjectEmpty()) {\
|
||||||
|
StringBuffer ssb;\
|
||||||
|
Writer<StringBuffer> ws(ssb);\
|
||||||
|
schema.GetError().Accept(ws);\
|
||||||
|
printf("Schema error: %s\n", ssb.GetString());\
|
||||||
|
}\
|
||||||
SchemaValidator validator(schema);\
|
SchemaValidator validator(schema);\
|
||||||
Document d;\
|
Document d;\
|
||||||
/*printf("\n%s\n", json);*/\
|
/*printf("\n%s\n", json);*/\
|
||||||
@ -156,6 +162,12 @@ TEST(SchemaValidator, Hasher) {
|
|||||||
flags, SchemaValidatorType, PointerType) \
|
flags, SchemaValidatorType, PointerType) \
|
||||||
{\
|
{\
|
||||||
EXPECT_TRUE(schema.GetError().ObjectEmpty());\
|
EXPECT_TRUE(schema.GetError().ObjectEmpty());\
|
||||||
|
if (!schema.GetError().ObjectEmpty()) {\
|
||||||
|
StringBuffer ssb;\
|
||||||
|
Writer<StringBuffer> ws(ssb);\
|
||||||
|
schema.GetError().Accept(ws);\
|
||||||
|
printf("Schema error: %s\n", ssb.GetString());\
|
||||||
|
}\
|
||||||
SchemaValidatorType validator(schema);\
|
SchemaValidatorType validator(schema);\
|
||||||
validator.SetValidateFlags(flags);\
|
validator.SetValidateFlags(flags);\
|
||||||
Document d;\
|
Document d;\
|
||||||
|
Loading…
x
Reference in New Issue
Block a user