diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-02 06:41:47 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-02 06:41:47 +0000 |
commit | 91715ee53b370e958a7c1a2e1036aa71eed66fc1 (patch) | |
tree | 15fc64af27f54199b3ec086d76da7ee8b72923d0 /test/ruby | |
parent | 1836af769cc8fc78a5d017b5a51aebfa6794f7b5 (diff) | |
download | ruby-91715ee53b370e958a7c1a2e1036aa71eed66fc1.tar.gz |
long long is a C99ism
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_pack.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/ruby/test_pack.rb b/test/ruby/test_pack.rb index 62a7a54e8d..475031bdfc 100644 --- a/test/ruby/test_pack.rb +++ b/test/ruby/test_pack.rb @@ -428,6 +428,7 @@ class TestPack < Test::Unit::TestCase assert_operator(4, :<=, [1].pack("L!").bytesize) end + require 'rbconfig' def test_pack_unpack_qQ s1 = [578437695752307201, -506097522914230529].pack("q*") s2 = [578437695752307201, 17940646550795321087].pack("Q*") @@ -437,6 +438,7 @@ class TestPack < Test::Unit::TestCase # Note: q! and Q! should not work on platform which has no long long type. # Is there a such platform now? + # @shyouhei: Yes. gcc -ansi is one of such platform. s1 = [578437695752307201, -506097522914230529].pack("q!*") s2 = [578437695752307201, 17940646550795321087].pack("Q!*") assert_equal([578437695752307201, -506097522914230529], s2.unpack("q!*")) @@ -446,7 +448,7 @@ class TestPack < Test::Unit::TestCase assert_equal(8, [1].pack("Q").bytesize) assert_operator(8, :<=, [1].pack("q!").bytesize) assert_operator(8, :<=, [1].pack("Q!").bytesize) - end + end if RbConfig::CONFIG['HAVE_LONG_LONG'] def test_pack_unpack_jJ # Note: we assume that the size of intptr_t and uintptr_t equals to the size |