mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-30 22:43:14 +03:00
Fix Regextests
- One of the bug316338 test cases is expected to succeed. - Memory leak in testRegexp.c. - Refcount handling in xmlExpHashGetEntry.
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
Regexp: (((C|c)(([\s]*\-?[0-9]+(\.[0-9]+)?((e|E)\-?[0-9]+)?){3})+[\s]*))+
|
Regexp: (((C|c)(([\s]*\-?[0-9]+(\.[0-9]+)?((e|E)\-?[0-9]+)?){3})+[\s]*))+
|
||||||
C 433: Ok
|
C 433: Ok
|
||||||
C 433 12: Fail
|
C 433 12: Ok
|
||||||
C 433 123: Ok
|
C 433 123: Ok
|
||||||
C 433 123 456: Ok
|
C 433 123 456: Ok
|
||||||
C 724.64,433.12 718.08,433.12 711.52,433.12 724.64,433.12 718.08,433.12 711.52,433.12 724.64,433.12 718.08,433.12 711.52,433.12 724.64,433.12 718.08,433.12 711.52,433.12 724.64,433.12 718.08,433.12 711.52,433.12 724.64,433.12 718.08,433.12 711.52,433.12 724.64,433.12 718.08,433.12 711.52,433.12 724.64,433.12 718.08,433.12 711.52,433.12 724.64,433.12 718.08,433.12 711.52,433.12 724.64,433.12 718.08,433.12 711.52,433.12: Fail
|
C 724.64,433.12 718.08,433.12 711.52,433.12 724.64,433.12 718.08,433.12 711.52,433.12 724.64,433.12 718.08,433.12 711.52,433.12 724.64,433.12 718.08,433.12 711.52,433.12 724.64,433.12 718.08,433.12 711.52,433.12 724.64,433.12 718.08,433.12 711.52,433.12 724.64,433.12 718.08,433.12 711.52,433.12 724.64,433.12 718.08,433.12 711.52,433.12 724.64,433.12 718.08,433.12 711.52,433.12 724.64,433.12 718.08,433.12 711.52,433.12: Fail
|
||||||
|
@ -185,20 +185,19 @@ static void
|
|||||||
testReduce(xmlExpCtxtPtr ctxt, xmlExpNodePtr expr, const char *tst) {
|
testReduce(xmlExpCtxtPtr ctxt, xmlExpNodePtr expr, const char *tst) {
|
||||||
xmlBufferPtr xmlExpBuf;
|
xmlBufferPtr xmlExpBuf;
|
||||||
xmlExpNodePtr sub, deriv;
|
xmlExpNodePtr sub, deriv;
|
||||||
xmlExpBuf = xmlBufferCreate();
|
|
||||||
|
|
||||||
sub = xmlExpParse(ctxt, tst);
|
sub = xmlExpParse(ctxt, tst);
|
||||||
if (sub == NULL) {
|
if (sub == NULL) {
|
||||||
printf("Subset %s failed to parse\n", tst);
|
printf("Subset %s failed to parse\n", tst);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
xmlExpBuf = xmlBufferCreate();
|
||||||
xmlExpDump(xmlExpBuf, sub);
|
xmlExpDump(xmlExpBuf, sub);
|
||||||
printf("Subset parsed as: %s\n",
|
printf("Subset parsed as: %s\n",
|
||||||
(const char *) xmlBufferContent(xmlExpBuf));
|
(const char *) xmlBufferContent(xmlExpBuf));
|
||||||
deriv = xmlExpExpDerive(ctxt, expr, sub);
|
deriv = xmlExpExpDerive(ctxt, expr, sub);
|
||||||
if (deriv == NULL) {
|
if (deriv == NULL) {
|
||||||
printf("Derivation led to an internal error, report this !\n");
|
printf("Derivation led to an internal error, report this !\n");
|
||||||
return;
|
|
||||||
} else {
|
} else {
|
||||||
xmlBufferEmpty(xmlExpBuf);
|
xmlBufferEmpty(xmlExpBuf);
|
||||||
xmlExpDump(xmlExpBuf, deriv);
|
xmlExpDump(xmlExpBuf, deriv);
|
||||||
@ -210,6 +209,7 @@ testReduce(xmlExpCtxtPtr ctxt, xmlExpNodePtr expr, const char *tst) {
|
|||||||
(const char *) xmlBufferContent(xmlExpBuf));
|
(const char *) xmlBufferContent(xmlExpBuf));
|
||||||
xmlExpFree(ctxt, deriv);
|
xmlExpFree(ctxt, deriv);
|
||||||
}
|
}
|
||||||
|
xmlBufferFree(xmlExpBuf);
|
||||||
xmlExpFree(ctxt, sub);
|
xmlExpFree(ctxt, sub);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6629,7 +6629,7 @@ xmlExpHashGetEntry(xmlExpCtxtPtr ctxt, xmlExpNodeType type,
|
|||||||
/* OR reduction rule 1 */
|
/* OR reduction rule 1 */
|
||||||
/* a | a reduced to a */
|
/* a | a reduced to a */
|
||||||
if (left == right) {
|
if (left == right) {
|
||||||
left->ref--;
|
xmlExpFree(ctxt, right);
|
||||||
return(left);
|
return(left);
|
||||||
}
|
}
|
||||||
/* OR canonicalization rule 1 */
|
/* OR canonicalization rule 1 */
|
||||||
|
Reference in New Issue
Block a user