Commits

ma...@9ae0c189-cd1f-4510-a509-f4891f5cf20d  committed 8541d48

A test that caused a segfault, revealed by porting AxKit XSP to XML::LibXML

  • Participants
  • Parent commits c9a7f5f

Comments (0)

Files changed (1)

File t/11memory.t

+use Test;
+BEGIN { plan tests => 5 }
+use XML::LibXML;
+ok(1);
+
+sub make_doc {
+my ($r, $cgi) = @_;
+my $document = XML::LibXML::Document->createDocument("1.0", "UTF-8");
+# warn("document: $document\n");
+my ($parent);
+
+{ my $elem = $document->createElement(q(p));$document->setDocumentElement($elem); $parent = $elem; }
+$parent->setAttribute("xmlns:" . q(param), q(http://axkit.org/XSP/param));
+{ my $elem = $document->createElement(q(param:foo));$parent->appendChild($elem); $parent = $elem; }
+$parent = $parent->getParentNode;
+# warn("parent now: $parent\n");
+$parent = $parent->getParentNode;
+# warn("parent now: $parent\n");
+
+return $document
+}
+
+my $doc = make_doc();
+ok($doc);
+
+ok($doc->toString);
+
+ok(1); ok(1);