Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libxml2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
73
Issues
73
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GNOME
libxml2
Commits
dcae579e
Commit
dcae579e
authored
Jan 01, 2019
by
Nick Wellnhofer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unneeded function pointer casts
parent
19f0950d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
42 deletions
+15
-42
runsuite.c
runsuite.c
+11
-26
runtest.c
runtest.c
+4
-16
No files found.
runsuite.c
View file @
dcae579e
...
@@ -327,10 +327,8 @@ xsdIncorectTestCase(xmlNodePtr cur) {
...
@@ -327,10 +327,8 @@ xsdIncorectTestCase(xmlNodePtr cur) {
}
}
xmlNodeDump
(
buf
,
test
->
doc
,
test
,
0
,
0
);
xmlNodeDump
(
buf
,
test
->
doc
,
test
,
0
,
0
);
pctxt
=
xmlRelaxNGNewMemParserCtxt
((
const
char
*
)
buf
->
content
,
buf
->
use
);
pctxt
=
xmlRelaxNGNewMemParserCtxt
((
const
char
*
)
buf
->
content
,
buf
->
use
);
xmlRelaxNGSetParserErrors
(
pctxt
,
xmlRelaxNGSetParserErrors
(
pctxt
,
testErrorHandler
,
testErrorHandler
,
(
xmlRelaxNGValidityErrorFunc
)
testErrorHandler
,
pctxt
);
(
xmlRelaxNGValidityWarningFunc
)
testErrorHandler
,
pctxt
);
rng
=
xmlRelaxNGParse
(
pctxt
);
rng
=
xmlRelaxNGParse
(
pctxt
);
xmlRelaxNGFreeParserCtxt
(
pctxt
);
xmlRelaxNGFreeParserCtxt
(
pctxt
);
if
(
rng
!=
NULL
)
{
if
(
rng
!=
NULL
)
{
...
@@ -462,10 +460,8 @@ xsdTestCase(xmlNodePtr tst) {
...
@@ -462,10 +460,8 @@ xsdTestCase(xmlNodePtr tst) {
}
}
xmlNodeDump
(
buf
,
test
->
doc
,
test
,
0
,
0
);
xmlNodeDump
(
buf
,
test
->
doc
,
test
,
0
,
0
);
pctxt
=
xmlRelaxNGNewMemParserCtxt
((
const
char
*
)
buf
->
content
,
buf
->
use
);
pctxt
=
xmlRelaxNGNewMemParserCtxt
((
const
char
*
)
buf
->
content
,
buf
->
use
);
xmlRelaxNGSetParserErrors
(
pctxt
,
xmlRelaxNGSetParserErrors
(
pctxt
,
testErrorHandler
,
testErrorHandler
,
(
xmlRelaxNGValidityErrorFunc
)
testErrorHandler
,
pctxt
);
(
xmlRelaxNGValidityWarningFunc
)
testErrorHandler
,
pctxt
);
rng
=
xmlRelaxNGParse
(
pctxt
);
rng
=
xmlRelaxNGParse
(
pctxt
);
xmlRelaxNGFreeParserCtxt
(
pctxt
);
xmlRelaxNGFreeParserCtxt
(
pctxt
);
if
(
extraMemoryFromResolver
)
if
(
extraMemoryFromResolver
)
...
@@ -510,9 +506,7 @@ xsdTestCase(xmlNodePtr tst) {
...
@@ -510,9 +506,7 @@ xsdTestCase(xmlNodePtr tst) {
nb_tests
++
;
nb_tests
++
;
ctxt
=
xmlRelaxNGNewValidCtxt
(
rng
);
ctxt
=
xmlRelaxNGNewValidCtxt
(
rng
);
xmlRelaxNGSetValidErrors
(
ctxt
,
xmlRelaxNGSetValidErrors
(
ctxt
,
(
xmlRelaxNGValidityErrorFunc
)
testErrorHandler
,
testErrorHandler
,
testErrorHandler
,
ctxt
);
(
xmlRelaxNGValidityWarningFunc
)
testErrorHandler
,
ctxt
);
ret
=
xmlRelaxNGValidateDoc
(
ctxt
,
doc
);
ret
=
xmlRelaxNGValidateDoc
(
ctxt
,
doc
);
xmlRelaxNGFreeValidCtxt
(
ctxt
);
xmlRelaxNGFreeValidCtxt
(
ctxt
);
if
(
ret
>
0
)
{
if
(
ret
>
0
)
{
...
@@ -567,9 +561,7 @@ xsdTestCase(xmlNodePtr tst) {
...
@@ -567,9 +561,7 @@ xsdTestCase(xmlNodePtr tst) {
nb_tests
++
;
nb_tests
++
;
ctxt
=
xmlRelaxNGNewValidCtxt
(
rng
);
ctxt
=
xmlRelaxNGNewValidCtxt
(
rng
);
xmlRelaxNGSetValidErrors
(
ctxt
,
xmlRelaxNGSetValidErrors
(
ctxt
,
(
xmlRelaxNGValidityErrorFunc
)
testErrorHandler
,
testErrorHandler
,
testErrorHandler
,
ctxt
);
(
xmlRelaxNGValidityWarningFunc
)
testErrorHandler
,
ctxt
);
ret
=
xmlRelaxNGValidateDoc
(
ctxt
,
doc
);
ret
=
xmlRelaxNGValidateDoc
(
ctxt
,
doc
);
xmlRelaxNGFreeValidCtxt
(
ctxt
);
xmlRelaxNGFreeValidCtxt
(
ctxt
);
if
(
ret
==
0
)
{
if
(
ret
==
0
)
{
...
@@ -825,10 +817,7 @@ xstcTestInstance(xmlNodePtr cur, xmlSchemaPtr schemas,
...
@@ -825,10 +817,7 @@ xstcTestInstance(xmlNodePtr cur, xmlSchemaPtr schemas,
}
}
ctxt
=
xmlSchemaNewValidCtxt
(
schemas
);
ctxt
=
xmlSchemaNewValidCtxt
(
schemas
);
xmlSchemaSetValidErrors
(
ctxt
,
xmlSchemaSetValidErrors
(
ctxt
,
testErrorHandler
,
testErrorHandler
,
ctxt
);
(
xmlSchemaValidityErrorFunc
)
testErrorHandler
,
(
xmlSchemaValidityWarningFunc
)
testErrorHandler
,
ctxt
);
ret
=
xmlSchemaValidateDoc
(
ctxt
,
doc
);
ret
=
xmlSchemaValidateDoc
(
ctxt
,
doc
);
if
(
xmlStrEqual
(
validity
,
BAD_CAST
"valid"
))
{
if
(
xmlStrEqual
(
validity
,
BAD_CAST
"valid"
))
{
...
@@ -916,10 +905,8 @@ xstcTestGroup(xmlNodePtr cur, const char *base) {
...
@@ -916,10 +905,8 @@ xstcTestGroup(xmlNodePtr cur, const char *base) {
if
(
xmlStrEqual
(
validity
,
BAD_CAST
"valid"
))
{
if
(
xmlStrEqual
(
validity
,
BAD_CAST
"valid"
))
{
nb_schematas
++
;
nb_schematas
++
;
ctxt
=
xmlSchemaNewParserCtxt
((
const
char
*
)
path
);
ctxt
=
xmlSchemaNewParserCtxt
((
const
char
*
)
path
);
xmlSchemaSetParserErrors
(
ctxt
,
xmlSchemaSetParserErrors
(
ctxt
,
testErrorHandler
,
testErrorHandler
,
(
xmlSchemaValidityErrorFunc
)
testErrorHandler
,
ctxt
);
(
xmlSchemaValidityWarningFunc
)
testErrorHandler
,
ctxt
);
schemas
=
xmlSchemaParse
(
ctxt
);
schemas
=
xmlSchemaParse
(
ctxt
);
xmlSchemaFreeParserCtxt
(
ctxt
);
xmlSchemaFreeParserCtxt
(
ctxt
);
if
(
schemas
==
NULL
)
{
if
(
schemas
==
NULL
)
{
...
@@ -952,10 +939,8 @@ xstcTestGroup(xmlNodePtr cur, const char *base) {
...
@@ -952,10 +939,8 @@ xstcTestGroup(xmlNodePtr cur, const char *base) {
}
else
if
(
xmlStrEqual
(
validity
,
BAD_CAST
"invalid"
))
{
}
else
if
(
xmlStrEqual
(
validity
,
BAD_CAST
"invalid"
))
{
nb_schematas
++
;
nb_schematas
++
;
ctxt
=
xmlSchemaNewParserCtxt
((
const
char
*
)
path
);
ctxt
=
xmlSchemaNewParserCtxt
((
const
char
*
)
path
);
xmlSchemaSetParserErrors
(
ctxt
,
xmlSchemaSetParserErrors
(
ctxt
,
testErrorHandler
,
testErrorHandler
,
(
xmlSchemaValidityErrorFunc
)
testErrorHandler
,
ctxt
);
(
xmlSchemaValidityWarningFunc
)
testErrorHandler
,
ctxt
);
schemas
=
xmlSchemaParse
(
ctxt
);
schemas
=
xmlSchemaParse
(
ctxt
);
xmlSchemaFreeParserCtxt
(
ctxt
);
xmlSchemaFreeParserCtxt
(
ctxt
);
if
(
schemas
!=
NULL
)
{
if
(
schemas
!=
NULL
)
{
...
...
runtest.c
View file @
dcae579e
...
@@ -3019,10 +3019,7 @@ schemasOneTest(const char *sch,
...
@@ -3019,10 +3019,7 @@ schemasOneTest(const char *sch,
}
}
ctxt
=
xmlSchemaNewValidCtxt
(
schemas
);
ctxt
=
xmlSchemaNewValidCtxt
(
schemas
);
xmlSchemaSetValidErrors
(
ctxt
,
xmlSchemaSetValidErrors
(
ctxt
,
testErrorHandler
,
testErrorHandler
,
ctxt
);
(
xmlSchemaValidityErrorFunc
)
testErrorHandler
,
(
xmlSchemaValidityWarningFunc
)
testErrorHandler
,
ctxt
);
validResult
=
xmlSchemaValidateDoc
(
ctxt
,
doc
);
validResult
=
xmlSchemaValidateDoc
(
ctxt
,
doc
);
if
(
validResult
==
0
)
{
if
(
validResult
==
0
)
{
fprintf
(
schemasOutput
,
"%s validates
\n
"
,
filename
);
fprintf
(
schemasOutput
,
"%s validates
\n
"
,
filename
);
...
@@ -3087,10 +3084,7 @@ schemasTest(const char *filename,
...
@@ -3087,10 +3084,7 @@ schemasTest(const char *filename,
/* first compile the schemas if possible */
/* first compile the schemas if possible */
ctxt
=
xmlSchemaNewParserCtxt
(
filename
);
ctxt
=
xmlSchemaNewParserCtxt
(
filename
);
xmlSchemaSetParserErrors
(
ctxt
,
xmlSchemaSetParserErrors
(
ctxt
,
testErrorHandler
,
testErrorHandler
,
ctxt
);
(
xmlSchemaValidityErrorFunc
)
testErrorHandler
,
(
xmlSchemaValidityWarningFunc
)
testErrorHandler
,
ctxt
);
schemas
=
xmlSchemaParse
(
ctxt
);
schemas
=
xmlSchemaParse
(
ctxt
);
xmlSchemaFreeParserCtxt
(
ctxt
);
xmlSchemaFreeParserCtxt
(
ctxt
);
...
@@ -3196,10 +3190,7 @@ rngOneTest(const char *sch,
...
@@ -3196,10 +3190,7 @@ rngOneTest(const char *sch,
}
}
ctxt
=
xmlRelaxNGNewValidCtxt
(
schemas
);
ctxt
=
xmlRelaxNGNewValidCtxt
(
schemas
);
xmlRelaxNGSetValidErrors
(
ctxt
,
xmlRelaxNGSetValidErrors
(
ctxt
,
testErrorHandler
,
testErrorHandler
,
ctxt
);
(
xmlRelaxNGValidityErrorFunc
)
testErrorHandler
,
(
xmlRelaxNGValidityWarningFunc
)
testErrorHandler
,
ctxt
);
ret
=
xmlRelaxNGValidateDoc
(
ctxt
,
doc
);
ret
=
xmlRelaxNGValidateDoc
(
ctxt
,
doc
);
if
(
ret
==
0
)
{
if
(
ret
==
0
)
{
testErrorHandler
(
NULL
,
"%s validates
\n
"
,
filename
);
testErrorHandler
(
NULL
,
"%s validates
\n
"
,
filename
);
...
@@ -3266,10 +3257,7 @@ rngTest(const char *filename,
...
@@ -3266,10 +3257,7 @@ rngTest(const char *filename,
/* first compile the schemas if possible */
/* first compile the schemas if possible */
ctxt
=
xmlRelaxNGNewParserCtxt
(
filename
);
ctxt
=
xmlRelaxNGNewParserCtxt
(
filename
);
xmlRelaxNGSetParserErrors
(
ctxt
,
xmlRelaxNGSetParserErrors
(
ctxt
,
testErrorHandler
,
testErrorHandler
,
ctxt
);
(
xmlRelaxNGValidityErrorFunc
)
testErrorHandler
,
(
xmlRelaxNGValidityWarningFunc
)
testErrorHandler
,
ctxt
);
schemas
=
xmlRelaxNGParse
(
ctxt
);
schemas
=
xmlRelaxNGParse
(
ctxt
);
xmlRelaxNGFreeParserCtxt
(
ctxt
);
xmlRelaxNGFreeParserCtxt
(
ctxt
);
...
...
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