summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--test/ruby/test_class.rb5
-rw-r--r--test/ruby/test_file.rb3
-rw-r--r--test/ruby/test_thread.rb6
4 files changed, 22 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 932ace7c3..38010340b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Mon Jun 2 21:56:47 2008 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * test/ruby/test_file.rb: add tests for uninitialized object.
+
+ * test/ruby/test_class.rb: ditto.
+
+ * test/ruby/test_thread.rb: ditto.
+
Mon Jun 2 21:44:15 2008 Yusuke Endoh <mame@tsg.ne.jp>
* re.c: fix SEGV by Regexp.allocate.names, Match.allocate.names, etc.
diff --git a/test/ruby/test_class.rb b/test/ruby/test_class.rb
index 8c035b5d5..b45c70ae5 100644
--- a/test/ruby/test_class.rb
+++ b/test/ruby/test_class.rb
@@ -146,4 +146,9 @@ class TestClass < Test::Unit::TestCase
assert_equal(":foo\n:foo\ntrue\ntrue", r.read.chomp)
end
end
+
+ def test_uninitialized
+ assert_raise(TypeError) { Class.allocate.new }
+ assert_raise(TypeError) { Class.allocate.superclass }
+ end
end
diff --git a/test/ruby/test_file.rb b/test/ruby/test_file.rb
index 22dc1a89e..26b29785a 100644
--- a/test/ruby/test_file.rb
+++ b/test/ruby/test_file.rb
@@ -115,4 +115,7 @@ class TestFile < Test::Unit::TestCase
}
end
+ def test_uninitialized
+ assert_raise(TypeError) { File::Stat.allocate.readable? }
+ end
end
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb
index 9abe39b10..e3a672442 100644
--- a/test/ruby/test_thread.rb
+++ b/test/ruby/test_thread.rb
@@ -499,4 +499,10 @@ class TestThreadGroup < Test::Unit::TestCase
}.join
t.join
end
+
+ def test_uninitialized
+ c = Class.new(Thread)
+ c.class_eval { def initialize; end }
+ assert_raise(ThreadError) { c.new.start }
+ end
end