summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorodaira <odaira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-18 18:05:47 +0000
committerodaira <odaira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-18 18:05:47 +0000
commit06037b54af05d65b2fcda359a455d546bbcda667 (patch)
tree0540f3cd943e06ab706fe74c2e1ae02e49a90390
parentb42eeaa7995af803ee3e268163f81b23372dc548 (diff)
* test/-ext-/time/test_new.rb (test_timespec_new): change a gmtoff
test to a better one that does not depend on whether the current time is in summer time or not. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--test/-ext-/time/test_new.rb8
2 files changed, 11 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index b04a376ee2..256e8b3546 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sat Mar 19 03:00:50 2016 Rei Odaira <Rei.Odaira@gmail.com>
+
+ * test/-ext-/time/test_new.rb (test_timespec_new): change a gmtoff
+ test to a better one that does not depend on whether the current
+ time is in summer time or not.
+
Fri Mar 19 00:00:00 2016 Kenta Murata <mrkn@mrkn.jp>
* bignum.c (rb_big_to_f, Bignum#to_f): removed them because they are
diff --git a/test/-ext-/time/test_new.rb b/test/-ext-/time/test_new.rb
index 67f5328819..8283bd6828 100644
--- a/test/-ext-/time/test_new.rb
+++ b/test/-ext-/time/test_new.rb
@@ -23,9 +23,11 @@ class Bug::Time::Test_New < Test::Unit::TestCase
assert_equal(false, Bug::Time.timespec_new(1447087832, 476451125, 0).utc?)
assert_equal(true, Bug::Time.timespec_new(1447087832, 476451125, 0x7ffffffe).utc?)
assert_equal(false, Bug::Time.timespec_new(1447087832, 476451125, 0x7fffffff).utc?)
- if Time.now.isdst == Bug::Time.timespec_new(1447087832, 476451125, 0x7fffffff).isdst
- assert_equal(Time.now.gmtoff, Bug::Time.timespec_new(1447087832, 476451125, 0x7fffffff).gmtoff)
- end
+ # Cannot compare Time.now.gmtoff with
+ # Bug::Time.timespec_new(1447087832, 476451125, 0x7fffffff).gmtoff, because
+ # it depends on whether the current time is in summer time (daylight-saving time) or not.
+ t = Time.now
+ assert_equal(t.gmtoff, Bug::Time.timespec_new(t.tv_sec, t.tv_nsec, 0x7fffffff).gmtoff)
assert_time_equal(Time.at(1447087832, 476451.125).localtime(86399),
Bug::Time.timespec_new(1447087832, 476451125, 86399))
assert_time_equal(Time.at(1447087832, 476451.125).localtime(-86399),