]> granicus.if.org Git - libexpat/commitdiff
Add test for well-formedness constraint: No Recursion.
authorFred L. Drake, Jr. <fdrake@users.sourceforge.net>
Sat, 24 Aug 2002 19:53:59 +0000 (19:53 +0000)
committerFred L. Drake, Jr. <fdrake@users.sourceforge.net>
Sat, 24 Aug 2002 19:53:59 +0000 (19:53 +0000)
expat/tests/runtests.c

index f6ff2d443923ddb611cbab87b5ed010272ab0431..e072c14d65746aa8ea747e6483e4747517928ec3 100644 (file)
@@ -590,6 +590,20 @@ START_TEST(test_wfc_undeclared_entity_with_external_subset) {
 }
 END_TEST
 
+START_TEST(test_wfc_no_recursive_entity_refs)
+{
+    char *text =
+        "<!DOCTYPE doc [\n"
+        "  <!ENTITY entity '&#38;entity;'>\n"
+        "]>\n"
+        "<doc>&entity;</doc>";
+
+    expect_failure(text,
+                   XML_ERROR_RECURSIVE_ENTITY_REF,
+                   "Parser did not report recursive entity reference.");
+}
+END_TEST
+
 
 /*
  * Namespaces tests.
@@ -777,6 +791,7 @@ make_basic_suite(void)
     tcase_add_test(tc_basic, test_wfc_undeclared_entity_no_external_subset);
     tcase_add_test(tc_basic, test_wfc_undeclared_entity_standalone);
     tcase_add_test(tc_basic, test_wfc_undeclared_entity_with_external_subset);
+    tcase_add_test(tc_basic, test_wfc_no_recursive_entity_refs);
 
     suite_add_tcase(s, tc_namespace);
     tcase_add_checked_fixture(tc_namespace,