Restore GDBM_File test skip patch for 5.28.3

This was removed as we created a new 5.28 version.

cf commit 0104479194
This commit is contained in:
Zak B. Elep 2020-06-05 14:06:28 +08:00
parent 1edb705f82
commit 9782265b95
8 changed files with 552 additions and 0 deletions

View file

@ -0,0 +1,69 @@
From 0d9e812de5885109532ec8bf484f165213ab97cb Mon Sep 17 00:00:00 2001
From: David Mitchell <davem@iabyn.com>
Date: Fri, 14 Dec 2018 16:54:42 +0000
Subject: [PATCH] ext/GDBM_File/t/fatal.t: handle non-fatality
This script is supposed to exercise the error handling callback
mechanism in gdbm, by triggering an error by surreptitiously closing
the file handle which gdbm has opened.
However, this doesn't trigger an error in newer releases of the gdbm
library, which uses mmap() rather than write() etc. In fact I can't see
any way of triggering an error: so just skip the relevant tests if we
can't trigger a failure.
---
ext/GDBM_File/t/fatal.t | 35 ++++++++++++++++++++++++++---------
1 file changed, 26 insertions(+), 9 deletions(-)
diff --git a/ext/GDBM_File/t/fatal.t b/ext/GDBM_File/t/fatal.t
index 3ba66be598c..159916901a9 100644
--- a/ext/GDBM_File/t/fatal.t
+++ b/ext/GDBM_File/t/fatal.t
@@ -1,4 +1,12 @@
#!./perl -w
+#
+# Exercise the error handling callback mechanism in gdbm.
+#
+# Try to trigger an error by surreptitiously closing the file handle which
+# gdbm has opened. Note that this won't trigger an error in newer
+# releases of the gdbm library, which uses mmap() rather than write() etc:
+# so skip in that case.
+
use strict;
use Test::More;
@@ -34,16 +42,25 @@ isnt((open $fh, "<&=$fileno"), undef, "dup fileno $fileno")
or diag("\$! = $!");
isnt(close $fh, undef,
"close fileno $fileno, out from underneath the GDBM_File");
-is(eval {
+
+# store some data to a closed file handle
+
+my $res = eval {
$h{Perl} = 'Rules';
untie %h;
- 1;
-}, undef, 'Trapped error when attempting to write to knobbled GDBM_File');
-
-# Observed "File write error" and "lseek error" from two different systems.
-# So there might be more variants. Important part was that we trapped the error
-# via croak.
-like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
- 'expected error message from GDBM_File');
+ 99;
+};
+
+SKIP: {
+ skip "Can't tigger failure", 2 if $res == 99;
+
+ is $res, undef, "eval should return undef";
+
+ # Observed "File write error" and "lseek error" from two different
+ # systems. So there might be more variants. Important part was that
+ # we trapped the error # via croak.
+ like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
+ 'expected error message from GDBM_File');
+}
unlink <fatal_dbmx*>;

View file

@ -0,0 +1,69 @@
From 0d9e812de5885109532ec8bf484f165213ab97cb Mon Sep 17 00:00:00 2001
From: David Mitchell <davem@iabyn.com>
Date: Fri, 14 Dec 2018 16:54:42 +0000
Subject: [PATCH] ext/GDBM_File/t/fatal.t: handle non-fatality
This script is supposed to exercise the error handling callback
mechanism in gdbm, by triggering an error by surreptitiously closing
the file handle which gdbm has opened.
However, this doesn't trigger an error in newer releases of the gdbm
library, which uses mmap() rather than write() etc. In fact I can't see
any way of triggering an error: so just skip the relevant tests if we
can't trigger a failure.
---
ext/GDBM_File/t/fatal.t | 35 ++++++++++++++++++++++++++---------
1 file changed, 26 insertions(+), 9 deletions(-)
diff --git a/ext/GDBM_File/t/fatal.t b/ext/GDBM_File/t/fatal.t
index 3ba66be598c..159916901a9 100644
--- a/ext/GDBM_File/t/fatal.t
+++ b/ext/GDBM_File/t/fatal.t
@@ -1,4 +1,12 @@
#!./perl -w
+#
+# Exercise the error handling callback mechanism in gdbm.
+#
+# Try to trigger an error by surreptitiously closing the file handle which
+# gdbm has opened. Note that this won't trigger an error in newer
+# releases of the gdbm library, which uses mmap() rather than write() etc:
+# so skip in that case.
+
use strict;
use Test::More;
@@ -34,16 +42,25 @@ isnt((open $fh, "<&=$fileno"), undef, "dup fileno $fileno")
or diag("\$! = $!");
isnt(close $fh, undef,
"close fileno $fileno, out from underneath the GDBM_File");
-is(eval {
+
+# store some data to a closed file handle
+
+my $res = eval {
$h{Perl} = 'Rules';
untie %h;
- 1;
-}, undef, 'Trapped error when attempting to write to knobbled GDBM_File');
-
-# Observed "File write error" and "lseek error" from two different systems.
-# So there might be more variants. Important part was that we trapped the error
-# via croak.
-like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
- 'expected error message from GDBM_File');
+ 99;
+};
+
+SKIP: {
+ skip "Can't tigger failure", 2 if $res == 99;
+
+ is $res, undef, "eval should return undef";
+
+ # Observed "File write error" and "lseek error" from two different
+ # systems. So there might be more variants. Important part was that
+ # we trapped the error # via croak.
+ like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
+ 'expected error message from GDBM_File');
+}
unlink <fatal_dbmx*>;

View file

@ -0,0 +1,69 @@
From 0d9e812de5885109532ec8bf484f165213ab97cb Mon Sep 17 00:00:00 2001
From: David Mitchell <davem@iabyn.com>
Date: Fri, 14 Dec 2018 16:54:42 +0000
Subject: [PATCH] ext/GDBM_File/t/fatal.t: handle non-fatality
This script is supposed to exercise the error handling callback
mechanism in gdbm, by triggering an error by surreptitiously closing
the file handle which gdbm has opened.
However, this doesn't trigger an error in newer releases of the gdbm
library, which uses mmap() rather than write() etc. In fact I can't see
any way of triggering an error: so just skip the relevant tests if we
can't trigger a failure.
---
ext/GDBM_File/t/fatal.t | 35 ++++++++++++++++++++++++++---------
1 file changed, 26 insertions(+), 9 deletions(-)
diff --git a/ext/GDBM_File/t/fatal.t b/ext/GDBM_File/t/fatal.t
index 3ba66be598c..159916901a9 100644
--- a/ext/GDBM_File/t/fatal.t
+++ b/ext/GDBM_File/t/fatal.t
@@ -1,4 +1,12 @@
#!./perl -w
+#
+# Exercise the error handling callback mechanism in gdbm.
+#
+# Try to trigger an error by surreptitiously closing the file handle which
+# gdbm has opened. Note that this won't trigger an error in newer
+# releases of the gdbm library, which uses mmap() rather than write() etc:
+# so skip in that case.
+
use strict;
use Test::More;
@@ -34,16 +42,25 @@ isnt((open $fh, "<&=$fileno"), undef, "dup fileno $fileno")
or diag("\$! = $!");
isnt(close $fh, undef,
"close fileno $fileno, out from underneath the GDBM_File");
-is(eval {
+
+# store some data to a closed file handle
+
+my $res = eval {
$h{Perl} = 'Rules';
untie %h;
- 1;
-}, undef, 'Trapped error when attempting to write to knobbled GDBM_File');
-
-# Observed "File write error" and "lseek error" from two different systems.
-# So there might be more variants. Important part was that we trapped the error
-# via croak.
-like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
- 'expected error message from GDBM_File');
+ 99;
+};
+
+SKIP: {
+ skip "Can't tigger failure", 2 if $res == 99;
+
+ is $res, undef, "eval should return undef";
+
+ # Observed "File write error" and "lseek error" from two different
+ # systems. So there might be more variants. Important part was that
+ # we trapped the error # via croak.
+ like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
+ 'expected error message from GDBM_File');
+}
unlink <fatal_dbmx*>;

View file

@ -0,0 +1,69 @@
From 0d9e812de5885109532ec8bf484f165213ab97cb Mon Sep 17 00:00:00 2001
From: David Mitchell <davem@iabyn.com>
Date: Fri, 14 Dec 2018 16:54:42 +0000
Subject: [PATCH] ext/GDBM_File/t/fatal.t: handle non-fatality
This script is supposed to exercise the error handling callback
mechanism in gdbm, by triggering an error by surreptitiously closing
the file handle which gdbm has opened.
However, this doesn't trigger an error in newer releases of the gdbm
library, which uses mmap() rather than write() etc. In fact I can't see
any way of triggering an error: so just skip the relevant tests if we
can't trigger a failure.
---
ext/GDBM_File/t/fatal.t | 35 ++++++++++++++++++++++++++---------
1 file changed, 26 insertions(+), 9 deletions(-)
diff --git a/ext/GDBM_File/t/fatal.t b/ext/GDBM_File/t/fatal.t
index 3ba66be598c..159916901a9 100644
--- a/ext/GDBM_File/t/fatal.t
+++ b/ext/GDBM_File/t/fatal.t
@@ -1,4 +1,12 @@
#!./perl -w
+#
+# Exercise the error handling callback mechanism in gdbm.
+#
+# Try to trigger an error by surreptitiously closing the file handle which
+# gdbm has opened. Note that this won't trigger an error in newer
+# releases of the gdbm library, which uses mmap() rather than write() etc:
+# so skip in that case.
+
use strict;
use Test::More;
@@ -34,16 +42,25 @@ isnt((open $fh, "<&=$fileno"), undef, "dup fileno $fileno")
or diag("\$! = $!");
isnt(close $fh, undef,
"close fileno $fileno, out from underneath the GDBM_File");
-is(eval {
+
+# store some data to a closed file handle
+
+my $res = eval {
$h{Perl} = 'Rules';
untie %h;
- 1;
-}, undef, 'Trapped error when attempting to write to knobbled GDBM_File');
-
-# Observed "File write error" and "lseek error" from two different systems.
-# So there might be more variants. Important part was that we trapped the error
-# via croak.
-like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
- 'expected error message from GDBM_File');
+ 99;
+};
+
+SKIP: {
+ skip "Can't tigger failure", 2 if $res == 99;
+
+ is $res, undef, "eval should return undef";
+
+ # Observed "File write error" and "lseek error" from two different
+ # systems. So there might be more variants. Important part was that
+ # we trapped the error # via croak.
+ like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
+ 'expected error message from GDBM_File');
+}
unlink <fatal_dbmx*>;

View file

@ -0,0 +1,69 @@
From 0d9e812de5885109532ec8bf484f165213ab97cb Mon Sep 17 00:00:00 2001
From: David Mitchell <davem@iabyn.com>
Date: Fri, 14 Dec 2018 16:54:42 +0000
Subject: [PATCH] ext/GDBM_File/t/fatal.t: handle non-fatality
This script is supposed to exercise the error handling callback
mechanism in gdbm, by triggering an error by surreptitiously closing
the file handle which gdbm has opened.
However, this doesn't trigger an error in newer releases of the gdbm
library, which uses mmap() rather than write() etc. In fact I can't see
any way of triggering an error: so just skip the relevant tests if we
can't trigger a failure.
---
ext/GDBM_File/t/fatal.t | 35 ++++++++++++++++++++++++++---------
1 file changed, 26 insertions(+), 9 deletions(-)
diff --git a/ext/GDBM_File/t/fatal.t b/ext/GDBM_File/t/fatal.t
index 3ba66be598c..159916901a9 100644
--- a/ext/GDBM_File/t/fatal.t
+++ b/ext/GDBM_File/t/fatal.t
@@ -1,4 +1,12 @@
#!./perl -w
+#
+# Exercise the error handling callback mechanism in gdbm.
+#
+# Try to trigger an error by surreptitiously closing the file handle which
+# gdbm has opened. Note that this won't trigger an error in newer
+# releases of the gdbm library, which uses mmap() rather than write() etc:
+# so skip in that case.
+
use strict;
use Test::More;
@@ -34,16 +42,25 @@ isnt((open $fh, "<&=$fileno"), undef, "dup fileno $fileno")
or diag("\$! = $!");
isnt(close $fh, undef,
"close fileno $fileno, out from underneath the GDBM_File");
-is(eval {
+
+# store some data to a closed file handle
+
+my $res = eval {
$h{Perl} = 'Rules';
untie %h;
- 1;
-}, undef, 'Trapped error when attempting to write to knobbled GDBM_File');
-
-# Observed "File write error" and "lseek error" from two different systems.
-# So there might be more variants. Important part was that we trapped the error
-# via croak.
-like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
- 'expected error message from GDBM_File');
+ 99;
+};
+
+SKIP: {
+ skip "Can't tigger failure", 2 if $res == 99;
+
+ is $res, undef, "eval should return undef";
+
+ # Observed "File write error" and "lseek error" from two different
+ # systems. So there might be more variants. Important part was that
+ # we trapped the error # via croak.
+ like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
+ 'expected error message from GDBM_File');
+}
unlink <fatal_dbmx*>;

View file

@ -0,0 +1,69 @@
From 0d9e812de5885109532ec8bf484f165213ab97cb Mon Sep 17 00:00:00 2001
From: David Mitchell <davem@iabyn.com>
Date: Fri, 14 Dec 2018 16:54:42 +0000
Subject: [PATCH] ext/GDBM_File/t/fatal.t: handle non-fatality
This script is supposed to exercise the error handling callback
mechanism in gdbm, by triggering an error by surreptitiously closing
the file handle which gdbm has opened.
However, this doesn't trigger an error in newer releases of the gdbm
library, which uses mmap() rather than write() etc. In fact I can't see
any way of triggering an error: so just skip the relevant tests if we
can't trigger a failure.
---
ext/GDBM_File/t/fatal.t | 35 ++++++++++++++++++++++++++---------
1 file changed, 26 insertions(+), 9 deletions(-)
diff --git a/ext/GDBM_File/t/fatal.t b/ext/GDBM_File/t/fatal.t
index 3ba66be598c..159916901a9 100644
--- a/ext/GDBM_File/t/fatal.t
+++ b/ext/GDBM_File/t/fatal.t
@@ -1,4 +1,12 @@
#!./perl -w
+#
+# Exercise the error handling callback mechanism in gdbm.
+#
+# Try to trigger an error by surreptitiously closing the file handle which
+# gdbm has opened. Note that this won't trigger an error in newer
+# releases of the gdbm library, which uses mmap() rather than write() etc:
+# so skip in that case.
+
use strict;
use Test::More;
@@ -34,16 +42,25 @@ isnt((open $fh, "<&=$fileno"), undef, "dup fileno $fileno")
or diag("\$! = $!");
isnt(close $fh, undef,
"close fileno $fileno, out from underneath the GDBM_File");
-is(eval {
+
+# store some data to a closed file handle
+
+my $res = eval {
$h{Perl} = 'Rules';
untie %h;
- 1;
-}, undef, 'Trapped error when attempting to write to knobbled GDBM_File');
-
-# Observed "File write error" and "lseek error" from two different systems.
-# So there might be more variants. Important part was that we trapped the error
-# via croak.
-like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
- 'expected error message from GDBM_File');
+ 99;
+};
+
+SKIP: {
+ skip "Can't tigger failure", 2 if $res == 99;
+
+ is $res, undef, "eval should return undef";
+
+ # Observed "File write error" and "lseek error" from two different
+ # systems. So there might be more variants. Important part was that
+ # we trapped the error # via croak.
+ like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
+ 'expected error message from GDBM_File');
+}
unlink <fatal_dbmx*>;

View file

@ -0,0 +1,69 @@
From 0d9e812de5885109532ec8bf484f165213ab97cb Mon Sep 17 00:00:00 2001
From: David Mitchell <davem@iabyn.com>
Date: Fri, 14 Dec 2018 16:54:42 +0000
Subject: [PATCH] ext/GDBM_File/t/fatal.t: handle non-fatality
This script is supposed to exercise the error handling callback
mechanism in gdbm, by triggering an error by surreptitiously closing
the file handle which gdbm has opened.
However, this doesn't trigger an error in newer releases of the gdbm
library, which uses mmap() rather than write() etc. In fact I can't see
any way of triggering an error: so just skip the relevant tests if we
can't trigger a failure.
---
ext/GDBM_File/t/fatal.t | 35 ++++++++++++++++++++++++++---------
1 file changed, 26 insertions(+), 9 deletions(-)
diff --git a/ext/GDBM_File/t/fatal.t b/ext/GDBM_File/t/fatal.t
index 3ba66be598c..159916901a9 100644
--- a/ext/GDBM_File/t/fatal.t
+++ b/ext/GDBM_File/t/fatal.t
@@ -1,4 +1,12 @@
#!./perl -w
+#
+# Exercise the error handling callback mechanism in gdbm.
+#
+# Try to trigger an error by surreptitiously closing the file handle which
+# gdbm has opened. Note that this won't trigger an error in newer
+# releases of the gdbm library, which uses mmap() rather than write() etc:
+# so skip in that case.
+
use strict;
use Test::More;
@@ -34,16 +42,25 @@ isnt((open $fh, "<&=$fileno"), undef, "dup fileno $fileno")
or diag("\$! = $!");
isnt(close $fh, undef,
"close fileno $fileno, out from underneath the GDBM_File");
-is(eval {
+
+# store some data to a closed file handle
+
+my $res = eval {
$h{Perl} = 'Rules';
untie %h;
- 1;
-}, undef, 'Trapped error when attempting to write to knobbled GDBM_File');
-
-# Observed "File write error" and "lseek error" from two different systems.
-# So there might be more variants. Important part was that we trapped the error
-# via croak.
-like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
- 'expected error message from GDBM_File');
+ 99;
+};
+
+SKIP: {
+ skip "Can't tigger failure", 2 if $res == 99;
+
+ is $res, undef, "eval should return undef";
+
+ # Observed "File write error" and "lseek error" from two different
+ # systems. So there might be more variants. Important part was that
+ # we trapped the error # via croak.
+ like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
+ 'expected error message from GDBM_File');
+}
unlink <fatal_dbmx*>;

View file

@ -0,0 +1,69 @@
From 0d9e812de5885109532ec8bf484f165213ab97cb Mon Sep 17 00:00:00 2001
From: David Mitchell <davem@iabyn.com>
Date: Fri, 14 Dec 2018 16:54:42 +0000
Subject: [PATCH] ext/GDBM_File/t/fatal.t: handle non-fatality
This script is supposed to exercise the error handling callback
mechanism in gdbm, by triggering an error by surreptitiously closing
the file handle which gdbm has opened.
However, this doesn't trigger an error in newer releases of the gdbm
library, which uses mmap() rather than write() etc. In fact I can't see
any way of triggering an error: so just skip the relevant tests if we
can't trigger a failure.
---
ext/GDBM_File/t/fatal.t | 35 ++++++++++++++++++++++++++---------
1 file changed, 26 insertions(+), 9 deletions(-)
diff --git a/ext/GDBM_File/t/fatal.t b/ext/GDBM_File/t/fatal.t
index 3ba66be598c..159916901a9 100644
--- a/ext/GDBM_File/t/fatal.t
+++ b/ext/GDBM_File/t/fatal.t
@@ -1,4 +1,12 @@
#!./perl -w
+#
+# Exercise the error handling callback mechanism in gdbm.
+#
+# Try to trigger an error by surreptitiously closing the file handle which
+# gdbm has opened. Note that this won't trigger an error in newer
+# releases of the gdbm library, which uses mmap() rather than write() etc:
+# so skip in that case.
+
use strict;
use Test::More;
@@ -34,16 +42,25 @@ isnt((open $fh, "<&=$fileno"), undef, "dup fileno $fileno")
or diag("\$! = $!");
isnt(close $fh, undef,
"close fileno $fileno, out from underneath the GDBM_File");
-is(eval {
+
+# store some data to a closed file handle
+
+my $res = eval {
$h{Perl} = 'Rules';
untie %h;
- 1;
-}, undef, 'Trapped error when attempting to write to knobbled GDBM_File');
-
-# Observed "File write error" and "lseek error" from two different systems.
-# So there might be more variants. Important part was that we trapped the error
-# via croak.
-like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
- 'expected error message from GDBM_File');
+ 99;
+};
+
+SKIP: {
+ skip "Can't tigger failure", 2 if $res == 99;
+
+ is $res, undef, "eval should return undef";
+
+ # Observed "File write error" and "lseek error" from two different
+ # systems. So there might be more variants. Important part was that
+ # we trapped the error # via croak.
+ like($@, qr/ at .*\bfatal\.t line \d+\.\n\z/,
+ 'expected error message from GDBM_File');
+}
unlink <fatal_dbmx*>;