b8c914
From 892e8b006aa99ac2c880cdc2a81fd16f06c1a0f3 Mon Sep 17 00:00:00 2001
b8c914
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
b8c914
Date: Mon, 9 Jul 2018 16:18:36 +0200
b8c914
Subject: [PATCH] Remove ext/GDBM_File/t/fatal.t
b8c914
MIME-Version: 1.0
b8c914
Content-Type: text/plain; charset=UTF-8
b8c914
Content-Transfer-Encoding: 8bit
b8c914
b8c914
gdbm-1.15 defaults to a memory-mapped I/O and does not report any I/O
b8c914
errors on store and close operations. Thus ext/GDBM_File/t/fatal.t
b8c914
test that expects these fatal error reports fails. Because there is
b8c914
no other way to provoke a fatal error in gdbm-1.15 this patch
b8c914
removes the test. Future gdbm version promisses reporting a regular
b8c914
error on closing a database.
b8c914
b8c914
RT#133295
b8c914
b8c914
Signed-off-by: Petr Písař <ppisar@redhat.com>
b8c914
---
b8c914
 MANIFEST                |  1 -
b8c914
 ext/GDBM_File/t/fatal.t | 49 -------------------------------------------------
b8c914
 2 files changed, 50 deletions(-)
b8c914
 delete mode 100644 ext/GDBM_File/t/fatal.t
b8c914
b8c914
diff --git a/MANIFEST b/MANIFEST
b8c914
index 95fa539095..b07fed1f54 100644
b8c914
--- a/MANIFEST
b8c914
+++ b/MANIFEST
b8c914
@@ -4100,7 +4100,6 @@ ext/GDBM_File/GDBM_File.pm	GDBM extension Perl module
b8c914
 ext/GDBM_File/GDBM_File.xs	GDBM extension external subroutines
b8c914
 ext/GDBM_File/hints/sco.pl	Hint for GDBM_File for named architecture
b8c914
 ext/GDBM_File/Makefile.PL	GDBM extension makefile writer
b8c914
-ext/GDBM_File/t/fatal.t		Test the fatal_func argument to gdbm_open
b8c914
 ext/GDBM_File/t/gdbm.t		See if GDBM_File works
b8c914
 ext/GDBM_File/typemap		GDBM extension interface types
b8c914
 ext/Hash-Util/Changes		Change history of Hash::Util
b8c914
diff --git a/ext/GDBM_File/t/fatal.t b/ext/GDBM_File/t/fatal.t
b8c914
deleted file mode 100644
b8c914
index 0e426d4dbc..0000000000
b8c914
--- a/ext/GDBM_File/t/fatal.t
b8c914
+++ /dev/null
b8c914
@@ -1,49 +0,0 @@
b8c914
-#!./perl -w
b8c914
-use strict;
b8c914
-
b8c914
-use Test::More;
b8c914
-use Config;
b8c914
-
b8c914
-BEGIN {
b8c914
-    plan(skip_all => "GDBM_File was not built")
b8c914
-	unless $Config{extensions} =~ /\bGDBM_File\b/;
b8c914
-
b8c914
-    # https://rt.perl.org/Public/Bug/Display.html?id=117967
b8c914
-    plan(skip_all => "GDBM_File is flaky in $^O")
b8c914
-        if $^O =~ /darwin/;
b8c914
-
b8c914
-    plan(tests => 8);
b8c914
-    use_ok('GDBM_File');
b8c914
-}
b8c914
-
b8c914
-unlink <Op_dbmx*>;
b8c914
-
b8c914
-open my $fh, '<', $^X or die "Can't open $^X: $!";
b8c914
-my $fileno = fileno $fh;
b8c914
-isnt($fileno, undef, "Can find next available file descriptor");
b8c914
-close $fh or die $!;
b8c914
-
b8c914
-is((open $fh, "<&=$fileno"), undef,
b8c914
-   "Check that we cannot open fileno $fileno. \$! is $!");
b8c914
-
b8c914
-umask(0);
b8c914
-my %h;
b8c914
-isa_ok(tie(%h, 'GDBM_File', 'Op_dbmx', GDBM_WRCREAT, 0640), 'GDBM_File');
b8c914
-
b8c914
-isnt((open $fh, "<&=$fileno"), undef, "dup fileno $fileno")
b8c914
-    or diag("\$! = $!");
b8c914
-isnt(close $fh, undef,
b8c914
-     "close fileno $fileno, out from underneath the GDBM_File");
b8c914
-is(eval {
b8c914
-    $h{Perl} = 'Rules';
b8c914
-    untie %h;
b8c914
-    1;
b8c914
-}, undef, 'Trapped error when attempting to write to knobbled GDBM_File');
b8c914
-
b8c914
-# Observed "File write error" and "lseek error" from two different systems.
b8c914
-# So there might be more variants. Important part was that we trapped the error
b8c914
-# via croak.
b8c914
-like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
b8c914
-     'expected error message from GDBM_File');
b8c914
-
b8c914
-unlink <Op_dbmx*>;
b8c914
-- 
b8c914
2.14.4
b8c914