Permalink
Browse files

Add a test for possible segfault

According to Andreas Voegele in RT #74777, this crashes on his system. It
doesn't crash on mine.
  • Loading branch information...
1 parent 8d63ac0 commit 9ee836d3917a2d21e803bf7d4dd29b4e02e540cd @autarch autarch committed Feb 9, 2012
Showing with 26 additions and 0 deletions.
  1. +26 −0 xt/release/xs-segfault.t
View
@@ -0,0 +1,26 @@
+use strict;
+use warnings;
+
+use Test::More;
+
+BEGIN {
+ $ENV{PARAMS_VALIDATE_IMPLEMENTATION} = 'XS';
+ $ENV{PV_WARN_FAILED_IMPLEMENTATION} = 1;
+}
+
+use Params::Validate qw( validate SCALAR );
+
+eval { foo( { a => 1 } ) };
+
+ok(1, 'did not segfault');
+
+done_testing();
+
+sub foo {
+ validate(
+ @_,
+ {
+ a => { type => SCALAR, depends => ['%s%s%s'] },
+ }
+ );
+}

0 comments on commit 9ee836d

Please sign in to comment.