Update of /cvsroot/compbench/CompBenchmarks++/CBM-PI/t
In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv3396
Modified Files:
00-XML.pl
Log Message:
Updated XML regression checks.
Index: 00-XML.pl
===================================================================
RCS file: /cvsroot/compbench/CompBenchmarks++/CBM-PI/t/00-XML.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** 00-XML.pl 21 Jan 2007 20:47:25 -0000 1.2
--- 00-XML.pl 23 Jan 2007 18:49:36 -0000 1.3
***************
*** 3,9 ****
use CBM;
! use Test::Simple tests => 32;
my $sys;
sub test_str {
--- 3,13 ----
use CBM;
! push(@INC, "lib");
! require "libtest.pl";
!
! use Test::Simple tests => 36;
my $sys;
+ our $top_srcdir;
sub test_str {
***************
*** 75,81 ****
test_node($root, "root", undef, 0);
! test_str($root, "<root/>\n");
test_node($child, "child", undef, 0);
! test_str($child, "<child/>\n");
$root->add($child);
--- 79,85 ----
test_node($root, "root", undef, 0);
! test_str($root, "<root/>");
test_node($child, "child", undef, 0);
! test_str($child, "<child/>");
$root->add($child);
***************
*** 83,92 ****
ok($child->childNumber() == 0);
test_node_eq($child, $root->getChild(0));
! test_str($root, "<root>\n <child/>\n</root>\n");
$root->setValue("root-value");
test_node($root, "root", "root-value", 1);
test_node($child, "child", undef, 0);
! test_str($root, "<root>\n <child/>\n root-value\n</root>\n");
my $att0 = CBM::XMLAttribute->new("att0");
--- 87,96 ----
ok($child->childNumber() == 0);
test_node_eq($child, $root->getChild(0));
! test_str($root, "<root>\n <child/>\n</root>");
$root->setValue("root-value");
test_node($root, "root", "root-value", 1);
test_node($child, "child", undef, 0);
! test_str($root, "<root>\n <child/>\n root-value\n</root>");
my $att0 = CBM::XMLAttribute->new("att0");
***************
*** 118,123 ****
EOF
;
! ok($root->str() eq $x);
}
--- 122,142 ----
EOF
;
+ chomp($x);
+ ok($root->str() eq $x, "EXPECTED:$x\nEOF\nHAS:" . $root->str() . "\nEOF");
+ }
! sub test_xml_files {
! my @files = ('compbenchmarks-0.xml',
! 'compbenchmarks-1.xml');
!
! foreach(@files) {
! my $X = CBM::XMLReader->new();
! ok(defined($X), "XMLReader instance for $_");
! my $fn = "$top_srcdir/reference/$_";
! my $e = `cat $fn`;
!
! my $H = $X->read($fn);
! ok($H->str() eq $e, "Parsing of $_:\nEXPECTED:$e\nEOF\nHAS*****:" . $H->str() . "\nEOF");
! }
}
***************
*** 126,129 ****
--- 145,149 ----
test_xml();
test_xml_sample();
+ test_xml_files();
$sys->done();
|