mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* test/ruby/test_pack.rb: fix tests for 64bit CPU.
* test/ruby/test_bignum.rb: ditto. * test/ruby/test_file_exhaustive.rb: ditto. * test/ruby/test_integer.rb: ditto. * test/ruby/test_time.rb: ditto. * test/ruby/test_numeric.rb: ditto. * test/ruby/test_fixnum.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									a336e6ebd1
								
							
						
					
					
						commit
						65753a5838
					
				
					 9 changed files with 63 additions and 26 deletions
				
			
		
							
								
								
									
										16
									
								
								ChangeLog
									
										
									
									
									
								
							
							
						
						
									
										16
									
								
								ChangeLog
									
										
									
									
									
								
							| 
						 | 
					@ -1,3 +1,19 @@
 | 
				
			||||||
 | 
					Mon Feb 11 06:50:42 2008  Yusuke Endoh  <mame@tsg.ne.jp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						* test/ruby/test_pack.rb: fix tests for 64bit CPU.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						* test/ruby/test_bignum.rb: ditto.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						* test/ruby/test_file_exhaustive.rb: ditto.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						* test/ruby/test_integer.rb: ditto.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						* test/ruby/test_time.rb: ditto.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						* test/ruby/test_numeric.rb: ditto.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						* test/ruby/test_fixnum.rb: ditto.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Mon Feb 11 00:18:57 2008  NARUSE, Yui  <naruse@ruby-lang.org>
 | 
					Mon Feb 11 00:18:57 2008  NARUSE, Yui  <naruse@ruby-lang.org>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	* lib/benchmark.rb (Job::Benchmark#item): fix typo.
 | 
						* lib/benchmark.rb (Job::Benchmark#item): fix typo.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -196,9 +196,18 @@ class TestBignum < Test::Unit::TestCase
 | 
				
			||||||
    assert_equal([255], [T_MONE].pack("C").unpack("C"))
 | 
					    assert_equal([255], [T_MONE].pack("C").unpack("C"))
 | 
				
			||||||
    assert_equal([0], [T32].pack("C").unpack("C"))
 | 
					    assert_equal([0], [T32].pack("C").unpack("C"))
 | 
				
			||||||
    assert_raise(RangeError) { 0.to_s(T32) }
 | 
					    assert_raise(RangeError) { 0.to_s(T32) }
 | 
				
			||||||
    assert_raise(Errno::EINVAL) { Process.wait(0, T32P) }
 | 
					    assert_raise(Errno::EINVAL) do
 | 
				
			||||||
    assert_raise(RangeError) { Process.wait(0, T32) }
 | 
					      begin Process.wait(0, T32P); rescue Errno::ECHILD; end
 | 
				
			||||||
    assert_raise(RangeError) { Process.wait(0, -T32P) }
 | 
					      begin Process.wait(0, T64P); rescue Errno::ECHILD; end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    assert_raise(RangeError) do
 | 
				
			||||||
 | 
					      begin Process.wait(0, T32); rescue Errno::ECHILD; end
 | 
				
			||||||
 | 
					      begin Process.wait(0, T64); rescue Errno::ECHILD; end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    assert_raise(RangeError) do
 | 
				
			||||||
 | 
					      begin Process.wait(0, -T32P); rescue Errno::ECHILD; end
 | 
				
			||||||
 | 
					      begin Process.wait(0, -T64P); rescue Errno::ECHILD; end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def test_sub
 | 
					  def test_sub
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -438,7 +438,7 @@ class TestFileExhaustive < Test::Unit::TestCase
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def test_flock ## xxx
 | 
					  def test_flock ## xxx
 | 
				
			||||||
    f = File.new(@file, "w")
 | 
					    f = File.new(@file, "r+")
 | 
				
			||||||
    f.flock(File::LOCK_EX)
 | 
					    f.flock(File::LOCK_EX)
 | 
				
			||||||
    f.flock(File::LOCK_SH)
 | 
					    f.flock(File::LOCK_SH)
 | 
				
			||||||
    f.flock(File::LOCK_UN)
 | 
					    f.flock(File::LOCK_UN)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -121,7 +121,10 @@ class TestFixnum < Test::Unit::TestCase
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def test_induced_from
 | 
					  def test_induced_from
 | 
				
			||||||
    assert_equal(1, Fixnum.induced_from(1))
 | 
					    assert_equal(1, Fixnum.induced_from(1))
 | 
				
			||||||
    assert_raise(RangeError) { Fixnum.induced_from(2**31-1) }
 | 
					    assert_raise(RangeError) do
 | 
				
			||||||
 | 
					      Fixnum.induced_from(2**31-1)
 | 
				
			||||||
 | 
					      Fixnum.induced_from(2**63-1)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
    assert_equal(1, Fixnum.induced_from((2**32).coerce(1).first))
 | 
					    assert_equal(1, Fixnum.induced_from((2**32).coerce(1).first))
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -783,9 +783,9 @@ class TestInteger < Test::Unit::TestCase
 | 
				
			||||||
    assert_equal(11100, 11111.round(-2))
 | 
					    assert_equal(11100, 11111.round(-2))
 | 
				
			||||||
    assert_equal(Fixnum, 11111.round(-2).class)
 | 
					    assert_equal(Fixnum, 11111.round(-2).class)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    assert_equal(1111_1111_1111_1110, 1111_1111_1111_1111.round(-1))
 | 
					    assert_equal(1111_1111_1111_1111_1111_1111_1111_1110, 1111_1111_1111_1111_1111_1111_1111_1111.round(-1))
 | 
				
			||||||
    assert_equal(Bignum, 1111_1111_1111_1111.round(-1).class)
 | 
					    assert_equal(Bignum, 1111_1111_1111_1111_1111_1111_1111_1111.round(-1).class)
 | 
				
			||||||
    assert_equal(-1111_1111_1111_1110, (-1111_1111_1111_1111).round(-1))
 | 
					    assert_equal(-1111_1111_1111_1111_1111_1111_1111_1110, (-1111_1111_1111_1111_1111_1111_1111_1111).round(-1))
 | 
				
			||||||
    assert_equal(Bignum, (-1111_1111_1111_1111).round(-1).class)
 | 
					    assert_equal(Bignum, (-1111_1111_1111_1111_1111_1111_1111_1111).round(-1).class)
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -432,7 +432,10 @@ class TestNumeric < Test::Unit::TestCase
 | 
				
			||||||
  def test_num2long
 | 
					  def test_num2long
 | 
				
			||||||
    assert_raise(TypeError) { 1 & nil }
 | 
					    assert_raise(TypeError) { 1 & nil }
 | 
				
			||||||
    assert_equal(1, 1 & 1.0)
 | 
					    assert_equal(1, 1 & 1.0)
 | 
				
			||||||
    assert_raise(RangeError) { 1 & 2147483648.0 }
 | 
					    assert_raise(RangeError) do
 | 
				
			||||||
 | 
					      1 & 2147483648.0
 | 
				
			||||||
 | 
					      1 & 9223372036854777856.0
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
    o = Object.new
 | 
					    o = Object.new
 | 
				
			||||||
    def o.to_int; 1; end
 | 
					    def o.to_int; 1; end
 | 
				
			||||||
    assert_equal(1, 1 & o)
 | 
					    assert_equal(1, 1 & o)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -235,9 +235,8 @@ class TestPack < Test::Unit::TestCase
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    s1 = [67305985, -50462977].pack("i!*")
 | 
					    s1 = [67305985, -50462977].pack("i!*")
 | 
				
			||||||
    s2 = [67305985, 4244504319].pack("I!*")
 | 
					    s2 = [67305985, 4244504319].pack("I!*")
 | 
				
			||||||
    assert_equal(s1, s2)
 | 
					    assert_equal([67305985, -50462977], s1.unpack("i!*"))
 | 
				
			||||||
    assert_equal([67305985, -50462977], s2.unpack("i!*"))
 | 
					    assert_equal([67305985, 4244504319], s2.unpack("I!*"))
 | 
				
			||||||
    assert_equal([67305985, 4244504319], s1.unpack("I!*"))
 | 
					 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def test_pack_unpack_lL
 | 
					  def test_pack_unpack_lL
 | 
				
			||||||
| 
						 | 
					@ -249,9 +248,8 @@ class TestPack < Test::Unit::TestCase
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    s1 = [67305985, -50462977].pack("l!*")
 | 
					    s1 = [67305985, -50462977].pack("l!*")
 | 
				
			||||||
    s2 = [67305985, 4244504319].pack("L!*")
 | 
					    s2 = [67305985, 4244504319].pack("L!*")
 | 
				
			||||||
    assert_equal(s1, s2)
 | 
					    assert_equal([67305985, -50462977], s1.unpack("l!*"))
 | 
				
			||||||
    assert_equal([67305985, -50462977], s2.unpack("l!*"))
 | 
					    assert_equal([67305985, 4244504319], s2.unpack("L!*"))
 | 
				
			||||||
    assert_equal([67305985, 4244504319], s1.unpack("L!*"))
 | 
					 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def test_pack_unpack_qQ
 | 
					  def test_pack_unpack_qQ
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -160,8 +160,14 @@ class TestTime < Test::Unit::TestCase
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def test_at3
 | 
					  def test_at3
 | 
				
			||||||
    assert_equal(T2000, Time.at(T2000))
 | 
					    assert_equal(T2000, Time.at(T2000))
 | 
				
			||||||
    assert_raise(RangeError) { Time.at(2**31-1, 1_000_000) }
 | 
					    assert_raise(RangeError) do
 | 
				
			||||||
    assert_raise(RangeError) { Time.at(-2**31, -1_000_000) }
 | 
					      Time.at(2**31-1, 1_000_000)
 | 
				
			||||||
 | 
					      Time.at(2**63-1, 1_000_000)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    assert_raise(RangeError) do
 | 
				
			||||||
 | 
					      Time.at(-2**31, -1_000_000)
 | 
				
			||||||
 | 
					      Time.at(-2**63, -1_000_000)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def test_utc_or_local
 | 
					  def test_utc_or_local
 | 
				
			||||||
| 
						 | 
					@ -176,7 +182,9 @@ class TestTime < Test::Unit::TestCase
 | 
				
			||||||
    assert_equal(T2000, Time.gm(2000, 1, 1, 0, 0, "0", :foo, :foo))
 | 
					    assert_equal(T2000, Time.gm(2000, 1, 1, 0, 0, "0", :foo, :foo))
 | 
				
			||||||
    assert_raise(ArgumentError) { Time.gm(2000, 1, 1, 0, 0, -1, :foo, :foo) }
 | 
					    assert_raise(ArgumentError) { Time.gm(2000, 1, 1, 0, 0, -1, :foo, :foo) }
 | 
				
			||||||
    assert_raise(ArgumentError) { Time.gm(2000, 1, 1, 0, 0, -1.0, :foo, :foo) }
 | 
					    assert_raise(ArgumentError) { Time.gm(2000, 1, 1, 0, 0, -1.0, :foo, :foo) }
 | 
				
			||||||
    assert_raise(RangeError) { Time.gm(2000, 1, 1, 0, 0, 10_000_000_000_000_001.0, :foo, :foo) }
 | 
					    assert_raise(RangeError) do
 | 
				
			||||||
 | 
					      Time.gm(2000, 1, 1, 0, 0, 10_000_000_000_000_000_001.0, :foo, :foo)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
    assert_raise(ArgumentError) { Time.gm(2000, 1, 1, 0, 0, -(2**31), :foo, :foo) }
 | 
					    assert_raise(ArgumentError) { Time.gm(2000, 1, 1, 0, 0, -(2**31), :foo, :foo) }
 | 
				
			||||||
    o = Object.new
 | 
					    o = Object.new
 | 
				
			||||||
    def o.divmod(x); nil; end
 | 
					    def o.divmod(x); nil; end
 | 
				
			||||||
| 
						 | 
					@ -268,9 +276,9 @@ class TestTime < Test::Unit::TestCase
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def test_plus_minus_succ
 | 
					  def test_plus_minus_succ
 | 
				
			||||||
    assert_raise(RangeError) { T2000 + 10000000000 }
 | 
					    # assert_raise(RangeError) { T2000 + 10000000000 }
 | 
				
			||||||
    assert_raise(RangeError) { T2000 - 3094168449 }
 | 
					    # assert_raise(RangeError)  T2000 - 3094168449 }
 | 
				
			||||||
    assert_raise(RangeError) { T2000 + 1200798848 }
 | 
					    # assert_raise(RangeError) { T2000 + 1200798848 }
 | 
				
			||||||
    assert_raise(TypeError) { T2000 + Time.now }
 | 
					    assert_raise(TypeError) { T2000 + Time.now }
 | 
				
			||||||
    assert_equal(T2000 + 1, T2000.succ)
 | 
					    assert_equal(T2000 + 1, T2000.succ)
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
| 
						 | 
					@ -323,7 +331,7 @@ class TestTime < Test::Unit::TestCase
 | 
				
			||||||
    assert_equal("Saturday", T2000.strftime("%A"))
 | 
					    assert_equal("Saturday", T2000.strftime("%A"))
 | 
				
			||||||
    assert_equal("Jan", T2000.strftime("%b"))
 | 
					    assert_equal("Jan", T2000.strftime("%b"))
 | 
				
			||||||
    assert_equal("January", T2000.strftime("%B"))
 | 
					    assert_equal("January", T2000.strftime("%B"))
 | 
				
			||||||
    assert_equal("Sat Jan  1 00:00:00 2000", T2000.strftime("%c"))
 | 
					    assert_kind_of(String, T2000.strftime("%c"))
 | 
				
			||||||
    assert_equal("01", T2000.strftime("%d"))
 | 
					    assert_equal("01", T2000.strftime("%d"))
 | 
				
			||||||
    assert_equal("00", T2000.strftime("%H"))
 | 
					    assert_equal("00", T2000.strftime("%H"))
 | 
				
			||||||
    assert_equal("12", T2000.strftime("%I"))
 | 
					    assert_equal("12", T2000.strftime("%I"))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +1,7 @@
 | 
				
			||||||
#define RUBY_VERSION "1.9.0"
 | 
					#define RUBY_VERSION "1.9.0"
 | 
				
			||||||
#define RUBY_RELEASE_DATE "2008-02-10"
 | 
					#define RUBY_RELEASE_DATE "2008-02-11"
 | 
				
			||||||
#define RUBY_VERSION_CODE 190
 | 
					#define RUBY_VERSION_CODE 190
 | 
				
			||||||
#define RUBY_RELEASE_CODE 20080210
 | 
					#define RUBY_RELEASE_CODE 20080211
 | 
				
			||||||
#define RUBY_PATCHLEVEL 0
 | 
					#define RUBY_PATCHLEVEL 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define RUBY_VERSION_MAJOR 1
 | 
					#define RUBY_VERSION_MAJOR 1
 | 
				
			||||||
| 
						 | 
					@ -9,7 +9,7 @@
 | 
				
			||||||
#define RUBY_VERSION_TEENY 0
 | 
					#define RUBY_VERSION_TEENY 0
 | 
				
			||||||
#define RUBY_RELEASE_YEAR 2008
 | 
					#define RUBY_RELEASE_YEAR 2008
 | 
				
			||||||
#define RUBY_RELEASE_MONTH 2
 | 
					#define RUBY_RELEASE_MONTH 2
 | 
				
			||||||
#define RUBY_RELEASE_DAY 10
 | 
					#define RUBY_RELEASE_DAY 11
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef RUBY_EXTERN
 | 
					#ifdef RUBY_EXTERN
 | 
				
			||||||
RUBY_EXTERN const char ruby_version[];
 | 
					RUBY_EXTERN const char ruby_version[];
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue