From: Chip Salzenberg Date: Mon, 24 Feb 1997 15:24:03 +0000 (+1200) Subject: Make *dbm tests work with Win32 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=544a35660dae17ef1feb6a04b0ee237bb0d8dcc1;p=p5sagit%2Fp5-mst-13.2.git Make *dbm tests work with Win32 --- diff --git a/t/lib/anydbm.t b/t/lib/anydbm.t index eeec2ca..6ddbf25 100755 --- a/t/lib/anydbm.t +++ b/t/lib/anydbm.t @@ -22,10 +22,14 @@ $Dfile = "Op.dbmx.pag"; if (! -e $Dfile) { ($Dfile) = ; } -($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime, - $blksize,$blocks) = stat($Dfile); -print (($mode & 0777) == ($^O eq 'os2' ? 0666 : 0640) || $^O eq 'amigaos' - ? "ok 2\n" : "not ok 2\n"); +if ($^O eq 'amigaos' || $^O eq 'os2' || $^O eq 'MSWin32') { + print "ok 2\n"; +} +else { + ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime, + $blksize,$blocks) = stat($Dfile); + print (($mode & 0777) == 0640 ? "ok 2\n" : "not ok 2\n"); +} while (($key,$value) = each(%h)) { $i++; } diff --git a/t/lib/gdbm.t b/t/lib/gdbm.t index 6a2d5fa..a0f081f 100755 --- a/t/lib/gdbm.t +++ b/t/lib/gdbm.t @@ -24,10 +24,14 @@ $Dfile = "Op.dbmx.pag"; if (! -e $Dfile) { ($Dfile) = ; } -($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime, - $blksize,$blocks) = stat($Dfile); -print (($mode & 0777) == ($^O eq 'os2' ? 0666 : 0640) || $^O eq 'amigaos' - ? "ok 2\n" : "not ok 2\n"); +if ($^O eq 'amigaos' || $^O eq 'os2' || $^O eq 'MSWin32') { + print "ok 2\n"; +} +else { + ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime, + $blksize,$blocks) = stat($Dfile); + print (($mode & 0777) == 0640 ? "ok 2\n" : "not ok 2\n"); +} while (($key,$value) = each(%h)) { $i++; } diff --git a/t/lib/ndbm.t b/t/lib/ndbm.t index 48f64fe..b10d7c2 100755 --- a/t/lib/ndbm.t +++ b/t/lib/ndbm.t @@ -27,10 +27,14 @@ $Dfile = "Op.dbmx.pag"; if (! -e $Dfile) { ($Dfile) = ; } -($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime, - $blksize,$blocks) = stat($Dfile); -print (($mode & 0777) == ($^O eq 'os2' ? 0666 : 0640) || $^O eq 'amigaos' - ? "ok 2\n" : "not ok 2\n"); +if ($^O eq 'amigaos' || $^O eq 'os2' || $^O eq 'MSWin32') { + print "ok 2\n"; +} +else { + ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime, + $blksize,$blocks) = stat($Dfile); + print (($mode & 0777) == 0640 ? "ok 2\n" : "not ok 2\n"); +} while (($key,$value) = each(%h)) { $i++; } diff --git a/t/lib/odbm.t b/t/lib/odbm.t index e83d0f9..06ba844 100755 --- a/t/lib/odbm.t +++ b/t/lib/odbm.t @@ -27,10 +27,14 @@ $Dfile = "Op.dbmx.pag"; if (! -e $Dfile) { ($Dfile) = ; } -($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime, - $blksize,$blocks) = stat($Dfile); -print (($mode & 0777) == ($^O eq 'os2' ? 0666 : 0640) || $^O eq 'amigaos' - ? "ok 2\n" : "not ok 2\n"); +if ($^O eq 'amigaos' || $^O eq 'os2' || $^O eq 'MSWin32') { + print "ok 2\n"; +} +else { + ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime, + $blksize,$blocks) = stat($Dfile); + print (($mode & 0777) == 0640 ? "ok 2\n" : "not ok 2\n"); +} while (($key,$value) = each(%h)) { $i++; } diff --git a/t/lib/sdbm.t b/t/lib/sdbm.t index b8e02ec..9928847 100755 --- a/t/lib/sdbm.t +++ b/t/lib/sdbm.t @@ -20,16 +20,21 @@ print "1..12\n"; unlink ; umask(0); -print (tie(%h,SDBM_File,'Op.dbmx', O_RDWR|O_CREAT, 0640) ? "ok 1\n" : "not ok 1\n"); +print (tie(%h,SDBM_File,'Op.dbmx', O_RDWR|O_CREAT, 0640) + ? "ok 1\n" : "not ok 1\n"); $Dfile = "Op.dbmx.pag"; if (! -e $Dfile) { ($Dfile) = ; } -($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime, - $blksize,$blocks) = stat($Dfile); -print (($mode & 0777) == ($^O eq 'os2' ? 0666 : 0640) || $^O eq 'amigaos' - ? "ok 2\n" : "not ok 2\n"); +if ($^O eq 'amigaos' || $^O eq 'os2' || $^O eq 'MSWin32') { + print "ok 2\n"; +} +else { + ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime, + $blksize,$blocks) = stat($Dfile); + print (($mode & 0777) == 0640 ? "ok 2\n" : "not ok 2\n"); +} while (($key,$value) = each(%h)) { $i++; }