Commit 99a864a1 authored by Nick Wellnhofer's avatar Nick Wellnhofer

Fix Regextests

- One of the bug316338 test cases is expected to succeed.
- Memory leak in testRegexp.c.
- Refcount handling in xmlExpHashGetEntry.
parent c2b0a184
Regexp: (((C|c)(([\s]*\-?[0-9]+(\.[0-9]+)?((e|E)\-?[0-9]+)?){3})+[\s]*))+
C 433: Ok
C 433 12: Fail
C 433 12: Ok
C 433 123: 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
......
......@@ -185,20 +185,19 @@ static void
testReduce(xmlExpCtxtPtr ctxt, xmlExpNodePtr expr, const char *tst) {
xmlBufferPtr xmlExpBuf;
xmlExpNodePtr sub, deriv;
xmlExpBuf = xmlBufferCreate();
sub = xmlExpParse(ctxt, tst);
if (sub == NULL) {
printf("Subset %s failed to parse\n", tst);
return;
}
xmlExpBuf = xmlBufferCreate();
xmlExpDump(xmlExpBuf, sub);
printf("Subset parsed as: %s\n",
(const char *) xmlBufferContent(xmlExpBuf));
deriv = xmlExpExpDerive(ctxt, expr, sub);
if (deriv == NULL) {
printf("Derivation led to an internal error, report this !\n");
return;
} else {
xmlBufferEmpty(xmlExpBuf);
xmlExpDump(xmlExpBuf, deriv);
......@@ -210,6 +209,7 @@ testReduce(xmlExpCtxtPtr ctxt, xmlExpNodePtr expr, const char *tst) {
(const char *) xmlBufferContent(xmlExpBuf));
xmlExpFree(ctxt, deriv);
}
xmlBufferFree(xmlExpBuf);
xmlExpFree(ctxt, sub);
}
......
......@@ -6629,7 +6629,7 @@ xmlExpHashGetEntry(xmlExpCtxtPtr ctxt, xmlExpNodeType type,
/* OR reduction rule 1 */
/* a | a reduced to a */
if (left == right) {
left->ref--;
xmlExpFree(ctxt, right);
return(left);
}
/* OR canonicalization rule 1 */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment