public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Don't run 32bit dependant assertions in 64bit environments

Signed-off-by: Michael Koziarski <michael@koziarski.com>
Tarmo Tänav (author)
Thu Sep 04 01:03:08 -0700 2008
NZKoz (committer)
Thu Sep 04 01:11:06 -0700 2008
commit  671bbd962e1a5430bd495329ef0d863dede01169
tree    a28f2631d233e8beaf2e5d16f4375dd02b17b7e7
parent  6ef35461dc7148ce37ed602d65a24f6c883fd044
...
524
525
526
527
528
529
530
531
532
533
 
 
534
535
536
...
546
547
548
549
 
 
 
 
550
551
552
...
624
625
626
 
 
 
 
627
628
629
...
524
525
526
 
527
528
529
530
 
 
531
532
533
534
535
...
545
546
547
 
548
549
550
551
552
553
554
...
626
627
628
629
630
631
632
633
634
635
0
@@ -524,13 +524,12 @@ class TimeExtCalculationsTest < Test::Unit::TestCase
0
     assert_equal Time.time_with_datetime_fallback(:utc, 2039, 2, 21, 17, 44, 30), DateTime.civil(2039, 2, 21, 17, 44, 30, 0, 0)
0
     assert_equal Time.time_with_datetime_fallback(:local, 2039, 2, 21, 17, 44, 30), DateTime.civil(2039, 2, 21, 17, 44, 30, DateTime.local_offset, 0)
0
     assert_equal Time.time_with_datetime_fallback(:utc, 1900, 2, 21, 17, 44, 30), DateTime.civil(1900, 2, 21, 17, 44, 30, 0, 0)
0
-    assert_equal Time.time_with_datetime_fallback(:local, 1900, 2, 21, 17, 44, 30), DateTime.civil(1900, 2, 21, 17, 44, 30, DateTime.local_offset, 0)
0
     assert_equal Time.time_with_datetime_fallback(:utc, 2005), Time.utc(2005)
0
     assert_equal Time.time_with_datetime_fallback(:utc, 2039), DateTime.civil(2039, 1, 1, 0, 0, 0, 0, 0)
0
     assert_equal Time.time_with_datetime_fallback(:utc, 2005, 2, 21, 17, 44, 30, 1), Time.utc(2005, 2, 21, 17, 44, 30, 1) #with usec
0
     # This won't overflow on 64bit linux
0
-    expected_to_overflow = Time.time_with_datetime_fallback(:utc, 2039, 2, 21, 17, 44, 30, 1)
0
-    unless expected_to_overflow.is_a?(Time)
0
+    unless time_is_64bits?
0
+      assert_equal Time.time_with_datetime_fallback(:local, 1900, 2, 21, 17, 44, 30), DateTime.civil(1900, 2, 21, 17, 44, 30, DateTime.local_offset, 0)
0
       assert_equal Time.time_with_datetime_fallback(:utc, 2039, 2, 21, 17, 44, 30, 1),
0
                    DateTime.civil(2039, 2, 21, 17, 44, 30, 0, 0)
0
       assert_equal ::Date::ITALY, Time.time_with_datetime_fallback(:utc, 2039, 2, 21, 17, 44, 30, 1).start # use Ruby's default start value
0
@@ -546,7 +545,10 @@ class TimeExtCalculationsTest < Test::Unit::TestCase
0
   def test_local_time
0
     assert_equal Time.local_time(2005, 2, 21, 17, 44, 30), Time.local(2005, 2, 21, 17, 44, 30)
0
     assert_equal Time.local_time(2039, 2, 21, 17, 44, 30), DateTime.civil(2039, 2, 21, 17, 44, 30, DateTime.local_offset, 0)
0
-    assert_equal Time.local_time(1901, 2, 21, 17, 44, 30), DateTime.civil(1901, 2, 21, 17, 44, 30, DateTime.local_offset, 0)
0
+
0
+    unless time_is_64bits?
0
+      assert_equal Time.local_time(1901, 2, 21, 17, 44, 30), DateTime.civil(1901, 2, 21, 17, 44, 30, DateTime.local_offset, 0)
0
+    end
0
   end
0
 
0
   def test_next_month_on_31st
0
@@ -624,6 +626,10 @@ class TimeExtCalculationsTest < Test::Unit::TestCase
0
     ensure
0
       old_tz ? ENV['TZ'] = old_tz : ENV.delete('TZ')
0
     end
0
+
0
+    def time_is_64bits?
0
+      Time.time_with_datetime_fallback(:utc, 2039, 2, 21, 17, 44, 30, 1).is_a?(Time)
0
+    end
0
 end
0
 
0
 class TimeExtMarshalingTest < Test::Unit::TestCase

Comments