diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-09-06 14:23:53 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-09-13 11:28:05 +0200 |
commit | 011985f17ca59c79ff083b0c4422ad2b8c7d05fa (patch) | |
tree | 2b54cc5b0b3572fa2641bd527f4eb58c91819d6f /ext/POSIX | |
parent | 4e453fcc36412d4d4c1f6ea1c3558786137b81db (diff) | |
download | perl-011985f17ca59c79ff083b0c4422ad2b8c7d05fa.tar.gz |
Add tests for passing POSIX::Termios->getcc() out of range subscripts.
Diffstat (limited to 'ext/POSIX')
-rw-r--r-- | ext/POSIX/t/termios.t | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/POSIX/t/termios.t b/ext/POSIX/t/termios.t index e68fb5ad35..636efe1670 100644 --- a/ext/POSIX/t/termios.t +++ b/ext/POSIX/t/termios.t @@ -54,6 +54,11 @@ if (defined $termios) { is($@, '', "calling getcc($i)"); like($r, qr/\A-?[0-9]+\z/, 'returns an integer'); } + for my $i (NCCS, ~0) { + my $r = eval { $termios->getcc($i) }; + like($@, qr/\ABad getcc subscript/, "calling getcc($i)"); + is($r, undef, 'returns undef') + } for my $method (qw(getcflag getiflag getispeed getlflag getoflag getospeed)) { my $r = eval { $termios->$method() }; |