Update of /cvsroot/compbench/CompBenchmarks++/CBM-PI/t
In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv21456
Modified Files:
05-Plan.pl
Log Message:
Tests added for restore*() methods.
Index: 05-Plan.pl
===================================================================
RCS file: /cvsroot/compbench/CompBenchmarks++/CBM-PI/t/05-Plan.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** 05-Plan.pl 25 Jan 2007 21:32:50 -0000 1.3
--- 05-Plan.pl 25 Jan 2007 22:09:39 -0000 1.4
***************
*** 6,10 ****
require "libtest.pl";
! use Test::Simple tests => 130;
my $sys;
--- 6,10 ----
require "libtest.pl";
! use Test::Simple tests => 136;
my $sys;
***************
*** 99,102 ****
--- 99,122 ----
chomp($x);
ok($P->XML()->str() eq $x, "$top_srcdir/reference/plan.xml matches");
+ ok($P->totalIterations() == 12, "total iterations is correct");
+ }
+
+ sub test_restore {
+ my $R = CBM::XMLReader->new();
+ my $X;
+
+ $P->reset();
+
+ ok($P->compilerNumber() == 0, "compiler number is correct");
+ ok($P->compilerOptionNumber() == 0, "options' number is correct");
+ ok($P->benchmarkNumber() == 0, "benchmark number is correct");
+ ok($P->nextIteration(0) == 0);
+
+ $X=$R->read("$top_srcdir/reference/plan.xml");
+ $P->restore($X);
+
+ my $x = `cat $top_srcdir/reference/plan.xml`;
+ chomp($x);
+ ok($P->XML()->str() eq $x, "$top_srcdir/reference/plan.xml matches");
}
***************
*** 105,108 ****
--- 125,129 ----
test_plan();
+ test_restore();
$sys->done();
|