diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-02 04:54:19 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-02 04:54:19 +0000 |
commit | 033c4a083d724f986bba85c769380ab0b579a484 (patch) | |
tree | 313127bfefacec92441050897238f7ae26bf75a0 /test/lib | |
parent | 6e0967ec6de2be595bd8de8725bfbe334fd1ed82 (diff) |
test: use RbConfig::Limits
* test/lib/envutil.rb: rbconfig/sizeof may not be available when
cross-compiling. use RbConfig::Limits instead of calculating
limits of Fixnum with hard-coded CHAR_BIT.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/lib')
-rw-r--r-- | test/lib/envutil.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/test/lib/envutil.rb b/test/lib/envutil.rb index 60c924041c..71848473be 100644 --- a/test/lib/envutil.rb +++ b/test/lib/envutil.rb @@ -3,15 +3,13 @@ require "open3" require "timeout" require_relative "find_executable" -require "rbconfig/sizeof" begin require 'rbconfig' rescue LoadError end - -class Integer - FIXNUM_MIN = -(1 << (8 * RbConfig::SIZEOF['long'] - 2)) - FIXNUM_MAX = (1 << (8 * RbConfig::SIZEOF['long'] - 2)) - 1 +begin + require "rbconfig/sizeof" +rescue LoadError end module EnvUtil |