/[pcre]/code/trunk/pcre_jit_test.c
ViewVC logotype

Diff of /code/trunk/pcre_jit_test.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 675 by ph10, Sat Aug 27 10:18:46 2011 UTC revision 677 by ph10, Sun Aug 28 10:50:07 2011 UTC
# Line 60  POSSIBILITY OF SUCH DAMAGE. Line 60  POSSIBILITY OF SUCH DAMAGE.
60  */  */
61    
62  static void setstack(pcre_extra *extra);  static void setstack(pcre_extra *extra);
63  static void regression_tests(void);  static int regression_tests(void);
64    
65  int main(void)  int main(void)
66  {  {
67          regression_tests();          return regression_tests();
         return 0;  
68  }  }
69    
70  static pcre_jit_stack* callback(void *arg)  static pcre_jit_stack* callback(void *arg)
# Line 567  static struct regression_test_case regre Line 566  static struct regression_test_case regre
566    
567          /* Deep recursion. */          /* Deep recursion. */
568          { MUA, 0, "((((?:(?:(?:\\w)+)?)*|(?>\\w)+?)+|(?>\\w)?\?)*)?\\s", "aaaaa+ " },          { MUA, 0, "((((?:(?:(?:\\w)+)?)*|(?>\\w)+?)+|(?>\\w)?\?)*)?\\s", "aaaaa+ " },
569          { MUA, 0, "(?:((?:(?:(?:\\w*?)+)??|(?>\\w)?|\\w*+)*)+)+?\\s", "aaa+ " },          { MUA, 0, "(?:((?:(?:(?:\\w*?)+)??|(?>\\w)?|\\w*+)*)+)+?\\s", "aa+ " },
570            { MUA, 0, "((a?)+)+b", "aaaaaaaaaaaaa b" },
571    
572            /* Deep recursion: Stack limit reached. */
573            { MA, 0, "a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?aaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaa" },
574            { MA, 0, "(?:a+)+b", "aaaaaaaaaaaaaaaaaaaaaaaa b" },
575            { MA, 0, "(?:a+?)+?b", "aaaaaaaaaaaaaaaaaaaaaaaa b" },
576            { MA, 0, "(?:a*)*b", "aaaaaaaaaaaaaaaaaaaaaaaa b" },
577            { MA, 0, "(?:a*?)*?b", "aaaaaaaaaaaaaaaaaaaaaaaa b" },
578    
579          { 0, 0, NULL, NULL }          { 0, 0, NULL, NULL }
580  };  };
581    
582  static void regression_tests(void)  static int regression_tests(void)
583  {  {
584          pcre *re;          pcre *re;
585          struct regression_test_case *current = regression_test_cases;          struct regression_test_case *current = regression_test_cases;
# Line 659  static void regression_tests(void) Line 666  static void regression_tests(void)
666                  succesful++;                  succesful++;
667          }          }
668    
669          if (total == succesful)          if (total == succesful) {
670                  printf("\nAll JIT regression tests are successfully passed.\n");                  printf("\nAll JIT regression tests are successfully passed.\n");
671          else                  return 0;
672            } else {
673                  printf("\nSuccessful test ratio: %d%%\n", succesful * 100 / total);                  printf("\nSuccessful test ratio: %d%%\n", succesful * 100 / total);
674                    return 1;
675            }
676  }  }
677    
678  /* End of pcre_jit_test.c */  /* End of pcre_jit_test.c */

Legend:
Removed from v.675  
changed lines
  Added in v.677

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12