Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
R
rapidjson
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
rapidjson
Commits
ca2061ac
Commit
ca2061ac
authored
May 06, 2015
by
miloyip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turn off some not-yet-implemented test cases, and fix a few
[ci skip]
parent
5ad3639d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
18 deletions
+26
-18
schema.h
include/rapidjson/schema.h
+3
-2
schematest.cpp
test/unittest/schematest.cpp
+23
-16
No files found.
include/rapidjson/schema.h
View file @
ca2061ac
...
...
@@ -960,8 +960,8 @@ public:
virtual
bool
StartObject
(
Context
&
)
const
{
return
false
;
}
virtual
bool
Key
(
Context
&
,
const
Ch
*
,
SizeType
,
bool
)
const
{
return
false
;
}
virtual
bool
EndObject
(
Context
&
,
SizeType
)
const
{
return
false
;
}
virtual
bool
StartArray
(
Context
&
)
const
{
return
tru
e
;
}
virtual
bool
EndArray
(
Context
&
,
SizeType
)
const
{
return
tru
e
;
}
virtual
bool
StartArray
(
Context
&
)
const
{
return
fals
e
;
}
virtual
bool
EndArray
(
Context
&
,
SizeType
)
const
{
return
fals
e
;
}
private
:
#if RAPIDJSON_SCHEMA_USE_STDREGEX
...
...
@@ -1350,6 +1350,7 @@ public:
while
(
!
schemaStack_
.
Empty
())
PopSchema
();
//documentStack_.Clear();
valid_
=
true
;
};
// Implementation of ISchemaValidator<Encoding>
...
...
test/unittest/schematest.cpp
View file @
ca2061ac
...
...
@@ -645,8 +645,8 @@ TEST(SchemaValidator, TestSuite) {
"additionalProperties.json"
,
"allOf.json"
,
"anyOf.json"
,
"definitions.json"
,
"dependencies.json"
,
//
"definitions.json",
//
"dependencies.json",
"enum.json"
,
"items.json"
,
"maximum.json"
,
...
...
@@ -660,16 +660,21 @@ TEST(SchemaValidator, TestSuite) {
"multipleOf.json"
,
"not.json"
,
"oneOf.json"
,
#if RAPIDJSON_SCHEMA_HAS_REGEX
"pattern.json"
,
"patternProperties.json"
,
#endif
"properties.json"
,
"ref.json"
,
"refRemote.json"
,
//
"ref.json",
//
"refRemote.json",
"required.json"
,
"type.json"
,
"uniqueItems.json"
//
"uniqueItems.json"
};
const
char
*
onlyRunDescription
=
0
;
//const char* onlyRunDescription = "a string is a string";
unsigned
testCount
=
0
;
unsigned
passCount
=
0
;
...
...
@@ -694,19 +699,21 @@ TEST(SchemaValidator, TestSuite) {
SchemaValidator
validator
(
schema
);
const
Value
&
tests
=
(
*
schemaItr
)[
"tests"
];
for
(
Value
::
ConstValueIterator
testItr
=
tests
.
Begin
();
testItr
!=
tests
.
End
();
++
testItr
)
{
testCount
++
;
const
Value
&
data
=
(
*
testItr
)[
"data"
];
bool
expected
=
(
*
testItr
)[
"valid"
].
GetBool
();
const
char
*
description
=
(
*
testItr
)[
"description"
].
GetString
();
validator
.
Reset
();
bool
actual
=
data
.
Accept
(
validator
);
if
(
expected
!=
actual
)
{
char
buffer
[
256
];
sprintf
(
buffer
,
"%s
\"
%s
\"
"
,
filename
,
description
);
GTEST_NONFATAL_FAILURE_
(
buffer
);
if
(
!
onlyRunDescription
||
strcmp
(
description
,
onlyRunDescription
)
==
0
)
{
const
Value
&
data
=
(
*
testItr
)[
"data"
];
bool
expected
=
(
*
testItr
)[
"valid"
].
GetBool
();
testCount
++
;
validator
.
Reset
();
bool
actual
=
data
.
Accept
(
validator
);
if
(
expected
!=
actual
)
{
char
buffer
[
256
];
sprintf
(
buffer
,
"%s
\"
%s
\"
"
,
filename
,
description
);
GTEST_NONFATAL_FAILURE_
(
buffer
);
}
else
passCount
++
;
}
else
passCount
++
;
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment