diff options
author | Nicholas Clark <nick@ccl4.org> | 2013-05-28 23:10:30 +0200 |
---|---|---|
committer | Abhijit Menon-Sen <ams@toroid.org> | 2013-07-13 22:14:59 +0530 |
commit | 3c1b273b7ca4f7e3e20e9dba260670dfb71a4425 (patch) | |
tree | ab3da992f8bcc1e70a774568441301be818ec6cf /dist | |
parent | f17010dab44137f3fb45ce35aa343cad9fc8fe0b (diff) | |
download | perl-3c1b273b7ca4f7e3e20e9dba260670dfb71a4425.tar.gz |
Tweak the new Storable destroy test, and the ChangeLog
Use Test::More instead of Test, as all the other tests now use Test::More.
Use 2-argument open to be compatible with 5.005. (Where it passes)
Close the test file before unlinking it.
Check the error returns of open and close.
Update the comment now that we have a better understanding of the bug's cause.
As the previous commit as applied had no 5.6 compatibility changes, remove
that note from the ChangeLog.
Diffstat (limited to 'dist')
-rw-r--r-- | dist/Storable/ChangeLog | 1 | ||||
-rw-r--r-- | dist/Storable/t/destroy.t | 11 |
2 files changed, 5 insertions, 7 deletions
diff --git a/dist/Storable/ChangeLog b/dist/Storable/ChangeLog index ceaf12890f..abfc8e0c5a 100644 --- a/dist/Storable/ChangeLog +++ b/dist/Storable/ChangeLog @@ -2,7 +2,6 @@ Thu May 23 09:59:33 CDT 2013 Reini Urban <rurban@cpanel.net> Protect against SEGV during global destruction when used in DESTROY blocks [perl #118139]. - Compatibility fixes back to 5.6. Wed May 8 18:27:42 2013 -0600 Karl Williamson <public@khwilliamson.com> Version 2.42 diff --git a/dist/Storable/t/destroy.t b/dist/Storable/t/destroy.t index c28ba251e6..e9464fb40d 100644 --- a/dist/Storable/t/destroy.t +++ b/dist/Storable/t/destroy.t @@ -1,16 +1,15 @@ -# [perl #118139] crash in global destruction when accessing an -# already freed PL_modglobal or accessing the freed cxt. -use Test; +# [perl #118139] crash in global destruction when accessing the freed cxt. +use Test::More tests => 1; use Storable; BEGIN { - plan tests => 1; store {}, "foo"; } package foo; sub new { return bless {} } DESTROY { - open $fh, "<", "foo"; - eval { Storable::pretrieve($fh); }; + open FH, "<foo" or die $!; + eval { Storable::pretrieve(*FH); }; + close FH or die $!; unlink "foo"; } |