aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_thread.rb
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-03 22:24:17 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-03 22:24:17 +0000
commit1ed310d1c53576192296a2e930cb580da05d91ff (patch)
tree219c7c9c3f40cfcdfc0dc021cc7ba4a72b2b0107 /test/ruby/test_thread.rb
parentdd19735fc47c33bd1accee1c14ea0c00b40d4f02 (diff)
downloadruby-1ed310d1c53576192296a2e930cb580da05d91ff.tar.gz
thread.c (thread_join_m): avoid NUM2TIMET for Bignum
Bignums exceed the range of time_t (or long). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_thread.rb')
-rw-r--r--test/ruby/test_thread.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb
index 1baaf889cb..6171c3a19e 100644
--- a/test/ruby/test_thread.rb
+++ b/test/ruby/test_thread.rb
@@ -1,6 +1,7 @@
# -*- coding: us-ascii -*-
# frozen_string_literal: false
require 'test/unit'
+require "rbconfig/sizeof"
class TestThread < Test::Unit::TestCase
class Thread < ::Thread
@@ -227,6 +228,14 @@ class TestThread < Test::Unit::TestCase
t3.kill if t3
end
+ def test_join_limits
+ [ RbConfig::LIMITS['FIXNUM_MAX'], RbConfig::LIMITS['UINT64_MAX'],
+ Float::INFINITY ].each do |limit|
+ t = Thread.new {}
+ assert_same t, t.join(limit), "limit=#{limit.inspect}"
+ end
+ end
+
def test_kill_main_thread
assert_in_out_err([], <<-INPUT, %w(1), [])
p 1