summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--test/ruby/test_thread.rb11
2 files changed, 16 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index d26cc67db2f..4d513ac2fcd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Jun 9 22:53:49 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * test/ruby/test_thread.rb (TestThread#test_kill_thread_subclass):
+ add test for Thread.kill with Thread subclass instance.
+
Thu Jun 9 22:31:47 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
* test/ruby/test_thread.rb (TestThread#test_kill_wrong_argument):
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb
index c2e592bb4b0..524a4fd14c3 100644
--- a/test/ruby/test_thread.rb
+++ b/test/ruby/test_thread.rb
@@ -305,6 +305,17 @@ class TestThread < Test::Unit::TestCase
assert_raise(TypeError, bug4367) {
Thread.kill(nil)
}
+ o = Object.new
+ assert_raise(TypeError, bug4367) {
+ Thread.kill(o)
+ }
+ end
+
+ def test_kill_thread_subclass
+ c = Class.new(Thread)
+ t = c.new { sleep 10 }
+ assert_nothing_raised { Thread.kill(t) }
+ assert_equal(nil, t.value)
end
def test_exit