Update of /cvsroot/twikiplugins/twikiplugins/DBCachePlugin/lib/TWiki/Contrib/DBCacheContrib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3553/lib/TWiki/Contrib/DBCacheContrib/test
Modified Files:
ArchiveTest.pm DBCacheContribSuite.pm DBCacheTest.pm
Log Message:
Updated tests
Index: ArchiveTest.pm
===================================================================
RCS file: /cvsroot/twikiplugins/twikiplugins/DBCachePlugin/lib/TWiki/Contrib/DBCacheContrib/test/ArchiveTest.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ArchiveTest.pm 16 Aug 2004 11:45:20 -0000 1.2
--- ArchiveTest.pm 25 May 2005 13:08:19 -0000 1.3
***************
*** 95,99 ****
# should now have a LOCK_SH, so a LOCK_EX should be blocked.
# This open for write should block.
! my $pid = open SUB, "| perl -e 'use lib \"../..\";use TWiki::Contrib::Archive;\$a = new TWiki::Contrib::Archive(\"data.dat\", \"w\");\$a->writeByte(\"X\");\$a->close();1;'";
sleep(1);
# OK, the child process has had plenty of time to wake up and should be
--- 95,109 ----
# should now have a LOCK_SH, so a LOCK_EX should be blocked.
# This open for write should block.
! my $inc = join(" ",@INC);
! my $cmd = <<DONE;
! | perl -e 'BEGIN{ \@INC=qw($inc); };
! require TWiki::Contrib::Archive;
! \$a = new TWiki::Contrib::Archive(\"data.dat\",
! \"w\");\$a->writeByte(\"X\");
! \$a->close();
! 1;'
! DONE
! $cmd =~ s/\n//go;
! my $pid = open SUB, $cmd;
sleep(1);
# OK, the child process has had plenty of time to wake up and should be
***************
*** 121,127 ****
$a1->close();
! my $cmd = "| perl -e '
! use lib \"../..\";
! use TWiki::Contrib::Archive;
\$a = new TWiki::Contrib::Archive(\"data.dat\", \"r\");
die unless(\$a->readByte() eq \"X\");
--- 131,139 ----
$a1->close();
! my $inc = join(" ",@INC);
! my $cmd = <<DONE;
! | perl -e '
! BEGIN{ \@INC=qw($inc); }
! require TWiki::Contrib::Archive;
\$a = new TWiki::Contrib::Archive(\"data.dat\", \"r\");
die unless(\$a->readByte() eq \"X\");
***************
*** 131,135 ****
die unless(\$a->readByte() eq \"Z\");
\$a->close();
! 1;'";
$cmd =~ s/\n//go;
my $p1 = open P1, $cmd;
--- 143,148 ----
die unless(\$a->readByte() eq \"Z\");
\$a->close();
! 1;'
! DONE
$cmd =~ s/\n//go;
my $p1 = open P1, $cmd;
***************
*** 162,166 ****
# Spawn a subprocess that tries to write
! my $pid = open SUB, "| perl -e 'use lib \"../..\";use TWiki::Contrib::Archive;\$a = new TWiki::Contrib::Archive(\"data.dat\", \"w\");\$a->writeByte(\"X\");\$a->close();1;'";
sleep(1);
# OK, the child process has had plenty of time to wake up and should be
--- 175,187 ----
# Spawn a subprocess that tries to write
! my $inc = join(" ",@INC);
! my $cmd = <<DONE;
! | perl -e 'BEGIN{ \@INC=qw($inc); };
! require TWiki::Contrib::Archive;
! \$a = new TWiki::Contrib::Archive("data.dat", "w");
! \$a->writeByte("X");\$a->close(); 1;'
! DONE
! $cmd =~ s/\n//go;
! my $pid = open SUB, $cmd;
sleep(1);
# OK, the child process has had plenty of time to wake up and should be
Index: DBCacheContribSuite.pm
===================================================================
RCS file: /cvsroot/twikiplugins/twikiplugins/DBCachePlugin/lib/TWiki/Contrib/DBCacheContrib/test/DBCacheContribSuite.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** DBCacheContribSuite.pm 14 Aug 2004 12:41:25 -0000 1.1
--- DBCacheContribSuite.pm 25 May 2005 13:08:19 -0000 1.2
***************
*** 6,11 ****
sub include_tests {
! # qw(ArrayTest MapTest ArchiveTest FileTimeTest SearchTest
! qw(DBCacheTest)
};
--- 6,10 ----
sub include_tests {
! qw(ArrayTest MapTest ArchiveTest FileTimeTest SearchTest DBCacheTest)
};
Index: DBCacheTest.pm
===================================================================
RCS file: /cvsroot/twikiplugins/twikiplugins/DBCachePlugin/lib/TWiki/Contrib/DBCacheContrib/test/DBCacheTest.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** DBCacheTest.pm 14 Aug 2004 12:41:25 -0000 1.1
--- DBCacheTest.pm 25 May 2005 13:08:19 -0000 1.2
***************
*** 192,197 ****
my ( $this, $first, $second, $cmping, $checked ) = @_;
- $this->assert_equals($first->size(), $second->size(), $cmping);
foreach my $k ($first->getKeys()) {
my $a = $first->fastget( $k ) || "";
my $b = $second->fastget( $k ) || "";
--- 192,197 ----
my ( $this, $first, $second, $cmping, $checked ) = @_;
foreach my $k ($first->getKeys()) {
+ next if $k eq "_up";
my $a = $first->fastget( $k ) || "";
my $b = $second->fastget( $k ) || "";
|