From: Ilya M. <m_...@us...> - 2003-05-21 10:17:48
|
Update of /cvsroot/perl-xml/XML-LibXML-XPathContext/t In directory sc8-pr-cvs1:/tmp/cvs-serv7499 Modified Files: 00-xpathcontext.t Log Message: Added testcase for segfault found by Steve Hay Index: 00-xpathcontext.t =================================================================== RCS file: /cvsroot/perl-xml/XML-LibXML-XPathContext/t/00-xpathcontext.t,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- 00-xpathcontext.t 11 Apr 2003 16:39:31 -0000 1.7 +++ 00-xpathcontext.t 21 May 2003 10:17:35 -0000 1.8 @@ -1,5 +1,5 @@ use Test; -BEGIN { plan tests => 27 }; +BEGIN { plan tests => 28 }; use XML::LibXML; use XML::LibXML::XPathContext; @@ -85,3 +85,15 @@ ok($xc4->findnodes('parent::*',$bar)->pop->nodeName eq 'foo'); ok($xc4->getContextNode->isSameNode($doc2->getDocumentElement)); + +# testcase for segfault found by Steve Hay +my $xc5 = XML::LibXML::XPathContext->new(); +$xc5->registerNs('pfx', 'http://www.foo.com'); +my $doc = XML::LibXML->new->parse_string('<foo xmlns="http://www.foo.com" />'); +$xc5->setContextNode($doc); +$xc5->findnodes('/'); +$xc5->setContextNode(undef); +$xc5->getContextNode(); +$xc5->setContextNode($doc); +$xc5->findnodes('/'); +ok(1); |