diff options
author | NAKAMURA Usaku <usa@ruby-lang.org> | 2022-03-19 22:23:08 +0900 |
---|---|---|
committer | NAKAMURA Usaku <usa@ruby-lang.org> | 2022-03-19 22:23:08 +0900 |
commit | 81f5453bd831e6f09e660fdf7e72d3d2da8753e7 (patch) | |
tree | 542f27636bf51b32f2fd10cc0756a3e56fd53cb7 /test | |
parent | ea9b0fe5d30efaa7dad1be4da79c1ee58f4f963b (diff) |
merge revision(s) 5c7af72304d0ad33cd3f21b24a4bc44e8acd5b2c,d650b17686d49c2ce8e6a87039861154e93d4621: [Backport #18497]
Assuming EXIT_SUCCESS equals 0 is not portable
---
test/ruby/test_fiber.rb | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
`rb_fiber_terminate` must not return [Bug #18497]
In a forked process from a fiber, the fiber becomes the only
fiber, `fiber_switch` does nothing as there is no other fibers,
`rb_fiber_terminate` does not terminate the fiber. In that case,
reaches the end of `fiber_entry` finaly, which is declared as
"COROUTINE" and should never return.
---
cont.c | 3 ++-
eval_intern.h | 2 +-
test/fiber/test_process.rb | 15 +++++++++++++++
test/ruby/test_fiber.rb | 5 +++++
4 files changed, 23 insertions(+), 2 deletions(-)
note that only backported a part of above patch because of incompatibility
of ruby_2_7.
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_fiber.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/ruby/test_fiber.rb b/test/ruby/test_fiber.rb index a7ed9ac7e0..20436eca69 100644 --- a/test/ruby/test_fiber.rb +++ b/test/ruby/test_fiber.rb @@ -318,7 +318,7 @@ class TestFiber < Test::Unit::TestCase Fiber.new {}.transfer Fiber.new { Fiber.yield } end - exit!(0) + exit!(true) end }.transfer _, status = Process.waitpid2(xpid) @@ -327,8 +327,8 @@ class TestFiber < Test::Unit::TestCase end.resume end pid, status = Process.waitpid2(pid) - assert_equal(0, status.exitstatus, bug5700) - assert_equal(false, status.signaled?, bug5700) + assert_not_predicate(status, :signaled?, bug5700) + assert_predicate(status, :success?, bug5700) end def test_exit_in_fiber |