diff options
author | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-12 04:55:50 +0000 |
---|---|---|
committer | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-12 04:55:50 +0000 |
commit | 89e2951bde9b7f4e04a8f068bfde6756aebf74af (patch) | |
tree | 4139a5a7fe3f0973f2129507b37656b536d6bd6e /test/ruby | |
parent | 888d8e93e1149991e2edaa5ddb78c11f803b4063 (diff) | |
download | ruby-89e2951bde9b7f4e04a8f068bfde6756aebf74af.tar.gz |
* signal.c (sig_trap): don't permit to change a signal handler which
the interpreter reserved.
* signal.c (reserved_signal_p): ditto.
[Bug #2616] [ruby-core:27625]
* test/ruby/test_signal.rb (TestSignal#test_reserved_signal):
added a test for reserved signal.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_signal.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/ruby/test_signal.rb b/test/ruby/test_signal.rb index c226fdd611..cd1f2c04b1 100644 --- a/test/ruby/test_signal.rb +++ b/test/ruby/test_signal.rb @@ -220,4 +220,29 @@ EOS t.close! assert_nil(error) end + + def test_reserved_signal + assert_raise(ArgumentError) { + Signal.trap(:SEGV) {} + } + assert_raise(ArgumentError) { + Signal.trap(:BUS) {} + } + assert_raise(ArgumentError) { + Signal.trap(:ILL) {} + } + assert_raise(ArgumentError) { + Signal.trap(:FPE) {} + } + assert_raise(ArgumentError) { + Signal.trap(:VTALRM) {} + } + assert_raise(ArgumentError) { + Signal.trap(:CHLD) {} + } + assert_raise(ArgumentError) { + Signal.trap(:CLD) {} + } + end + end |