BIND 10 master, updated. f3e39622ac840f6322cbc76277b2104ba4e8aee4 [master] corrected the type for the time in timeFromText64().
BIND 10 source code commits
bind10-changes at lists.isc.org
Sat Feb 19 22:13:01 UTC 2011
The branch, master has been updated
via f3e39622ac840f6322cbc76277b2104ba4e8aee4 (commit)
via f9ed88b3ab1f080f2e96219a70c7f6ba9026d547 (commit)
from 04934bb05de6689d170ff4d52c2518301df0f960 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit f3e39622ac840f6322cbc76277b2104ba4e8aee4
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Sat Feb 19 22:11:38 2011 +0000
[master] corrected the type for the time in timeFromText64().
the previous code used time_t, as a result of copying the pre #61 version,
which may not always be 64-bit.
commit f9ed88b3ab1f080f2e96219a70c7f6ba9026d547
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Sat Feb 19 22:08:42 2011 +0000
[master] s/L/LU/ to make sure constants are unsigned.
-----------------------------------------------------------------------
Summary of changes:
src/lib/dns/dnssectime.cc | 2 +-
src/lib/dns/tests/dnssectime_unittest.cc | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/dns/dnssectime.cc b/src/lib/dns/dnssectime.cc
index e70cb24..c889178 100644
--- a/src/lib/dns/dnssectime.cc
+++ b/src/lib/dns/dnssectime.cc
@@ -186,7 +186,7 @@ timeFromText64(const string& time_txt) {
checkRange(0, 59, minute, "minute");
checkRange(0, 60, second, "second"); // 60 == leap second.
- time_t timeval = second + (60 * minute) + (3600 * hour) +
+ uint64_t timeval = second + (60 * minute) + (3600 * hour) +
((day - 1) * 86400);
for (int m = 0; m < (month - 1); ++m) {
timeval += days[m] * 86400;
diff --git a/src/lib/dns/tests/dnssectime_unittest.cc b/src/lib/dns/tests/dnssectime_unittest.cc
index 278f88b..2f5d3c7 100644
--- a/src/lib/dns/tests/dnssectime_unittest.cc
+++ b/src/lib/dns/tests/dnssectime_unittest.cc
@@ -80,7 +80,7 @@ TEST_F(DNSSECTimeTest, fromText) {
// Feb 7, 06:28:15 UTC 2106 is the possible maximum time that can be
// represented as an unsigned 32bit integer without overflow.
- EXPECT_EQ(4294967295L, timeFromText32("21060207062815"));
+ EXPECT_EQ(4294967295LU, timeFromText32("21060207062815"));
// After that, timeFromText32() should start returning the second count
// modulo 2^32.
@@ -90,7 +90,7 @@ TEST_F(DNSSECTimeTest, fromText) {
// On the other hand, the 64-bit version should return monotonically
// increasing counters.
EXPECT_EQ(4294967296LL, timeFromText64("21060207062816"));
- EXPECT_EQ(4294967306LL, timeFromText64("21060207062826"));
+ EXPECT_EQ(static_cast<uint64_t>(4294967306LL), timeFromText64("21060207062826"));
}
// This helper templated function tells timeToText32 a faked current time.
@@ -150,14 +150,14 @@ TEST_F(DNSSECTimeTest, toText) {
// that can be represented in the form of YYYYMMDDHHmmSS.
EXPECT_EQ("99991231235959", timeToText64(YEAR10K_EVE));
dnssectime::detail::gettimeFunction = testGetTime<YEAR10K_EVE - 10>;
- EXPECT_EQ("99991231235959", timeToText32(4294197631L));
+ EXPECT_EQ("99991231235959", timeToText32(4294197631LU));
}
TEST_F(DNSSECTimeTest, overflow) {
// Jan 1, Year 10,000.
EXPECT_THROW(timeToText64(253402300800LL), InvalidTime);
dnssectime::detail::gettimeFunction = testGetTime<YEAR10K_EVE - 10>;
- EXPECT_THROW(timeToText32(4294197632L), InvalidTime);
+ EXPECT_THROW(timeToText32(4294197632LU), InvalidTime);
}
}
More information about the bind10-changes
mailing list