[前][次][番号順一覧][スレッド一覧][生データ]

yarv-diff:205

From: ko1 atdot.net
Date: 4 Feb 2006 07:23:26 -0000
Subject: [yarv-diff:205] r363 - in trunk: . test/ruby

Author: aamine
Date: 2006-02-04 16:23:26 +0900 (Sat, 04 Feb 2006)
New Revision: 363

Modified:
   trunk/ChangeLog
   trunk/test/ruby/test_pipe.rb
   trunk/test/ruby/test_signal.rb
Log:
* test/ruby/test_pipe.rb: remove useless require.
* test/ruby/test_signal.rb: turn off the test case which causes segmentation fault (tmp).


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2006-02-03 23:33:40 UTC (rev 362)
+++ trunk/ChangeLog	2006-02-04 07:23:26 UTC (rev 363)
@@ -4,6 +4,14 @@
 #  from Mon, 03 May 2004 01:24:19 +0900
 #
 
+2006-02-04(Sat) 16:22:38 +0900  Minero Aoki  <aamine loveruby.net>
+
+	* test/ruby/test_pipe.rb: remove useless require.
+
+	* test/ruby/test_signal.rb: turn off the test case which causes
+	  segmentation fault (tmp).
+
+
 2006-02-04(Sat) 08:19:50 +0900  Koichi Sasada  <ko1 atdot.net>
 
 	* common.mk : add dependency to yarvcore.h on signal.o

Modified: trunk/test/ruby/test_pipe.rb
===================================================================
--- trunk/test/ruby/test_pipe.rb	2006-02-03 23:33:40 UTC (rev 362)
+++ trunk/test/ruby/test_pipe.rb	2006-02-04 07:23:26 UTC (rev 363)
@@ -1,6 +1,5 @@
 require 'test/unit'
 require 'ut_eof'
-require 'envutil'
 
 class TestPipe < Test::Unit::TestCase
   include TestEOF

Modified: trunk/test/ruby/test_signal.rb
===================================================================
--- trunk/test/ruby/test_signal.rb	2006-02-03 23:33:40 UTC (rev 362)
+++ trunk/test/ruby/test_signal.rb	2006-02-04 07:23:26 UTC (rev 363)
@@ -1,45 +1,45 @@
 require 'test/unit'
 require 'timeout'
 
-class TestSignal # < Test::Unit::TestCase
+class TestSignal < Test::Unit::TestCase
   def have_fork?
     begin
-      fork{}
-      true
+      Process.fork {}
+      return true
     rescue NotImplementedError
-      false
+      return false
     end
   end
 
   def test_signal
-    defined?(Process.kill) or return
+    return unless Process.method_defined?(:kill)
     begin
-      $x = 0
-      oldtrap = trap "SIGINT", proc{|sig| $x = 2}
-      Process.kill "SIGINT", $$
+      x = 0
+      oldtrap = Signal.trap(:INT) {|sig| x = 2 }
+      Process.kill :INT, Process.pid
       sleep 0.1
-      assert_equal(2, $x)
+      assert_equal 2, x
 
-      trap "SIGINT", proc{raise "Interrupt"}
-
-      x = assert_raises(RuntimeError) do
-        Process.kill "SIGINT", $$
+      Signal.trap(:INT) { raise "Interrupt" }
+      ex = assert_raises(RuntimeError) {
+        Process.kill :INT, Process.pid
         sleep 0.1
-      end
-      assert(x)
-      assert_match(/Interrupt/, x.message)
+      }
+      assert_kind_of Exception, ex
+      assert_match(/Interrupt/, ex.message)
     ensure
-      trap "SIGINT", oldtrap
+      Signal.trap :INT, oldtrap if oldtrap
     end
   end
 
   def test_exit_action
+assert false, 'trap(XXX, "EXIT") causes segmentation fault [yarv-dev:806]'
     return unless have_fork?	# snip this test
     begin
       r, w = IO.pipe
       r0, w0 = IO.pipe
-      pid = fork {
-        trap(:USR1, "EXIT")
+      pid = Process.fork {
+        Signal.trap(:USR1, "EXIT")
         w0.close
         w.syswrite("a")
         Thread.start { Thread.pass }


-- 
ML: yarv-diff quickml.atdot.net
Info: http://www.atdot.net/~ko1/quickml

[前][次][番号順一覧][スレッド一覧][生データ]