BIND 10 rrl, updated. 4a63a255f66f7bd406a90913e9a37b206f6733db [rrl] Update unittest comments
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Dec 16 10:49:08 UTC 2013
The branch, rrl has been updated
via 4a63a255f66f7bd406a90913e9a37b206f6733db (commit)
from d4699dd393108be654b17fb415fb7a7ce6d5fdf0 (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 4a63a255f66f7bd406a90913e9a37b206f6733db
Author: Mukund Sivaraman <muks at isc.org>
Date: Mon Dec 16 15:51:52 2013 +0530
[rrl] Update unittest comments
-----------------------------------------------------------------------
Summary of changes:
src/bin/auth/rrl/tests/rrl_timestamps_unittest.cc | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/auth/rrl/tests/rrl_timestamps_unittest.cc b/src/bin/auth/rrl/tests/rrl_timestamps_unittest.cc
index 986b42f..37b5ab6 100644
--- a/src/bin/auth/rrl/tests/rrl_timestamps_unittest.cc
+++ b/src/bin/auth/rrl/tests/rrl_timestamps_unittest.cc
@@ -35,7 +35,7 @@ protected:
size_t callback_param_; // remember parameter of the latest callback
- typedef RRLTimeStampBases<4, 4096> TestBases;
+ typedef RRLTimeStampBases<4, 4096> TestBases;
TestBases ts_bases_;
void callback(size_t gen) { callback_param_ = gen; }
@@ -45,13 +45,15 @@ protected:
TEST_F(RRLTimestampsTest, deltaTime) {
// Normal case: now > recorded timestamp
EXPECT_EQ(10, TestBases::deltaTime(10, 20));
+
// Same if now == timestamp
EXPECT_EQ(0, TestBases::deltaTime(10, 10));
- // timestamp is "near future". diff is considered 0.
+ // timestamp is "near future". diff should be considered 0.
EXPECT_EQ(0, TestBases::deltaTime(11, 10));
- // timestamp in "distant future" is considered clock changes.
+ // timestamp in "distant future" (from clock changes). The
+ // difference should be "forever" here.
EXPECT_EQ(4096, TestBases::deltaTime(16, 10));
}
@@ -66,8 +68,8 @@ TEST_F(RRLTimestampsTest, getCurrentBase) {
EXPECT_EQ(0, result.second);
EXPECT_EQ(65536, callback_param_); // callback shouldn't be called
- // If the current base is in "future", the given 'now' is basically
- // re-interpreted as if it's that future value.
+ // If the current base is in "near-future", the given 'now' is
+ // basically re-interpreted as if it's that future value.
result = ts_bases_.getCurrentBase(now - 1);
EXPECT_EQ(100, result.first);
EXPECT_EQ(0, result.second);
@@ -80,8 +82,8 @@ TEST_F(RRLTimestampsTest, getCurrentBase) {
EXPECT_EQ(1, result.second);
EXPECT_EQ(1, callback_param_); // callback should be called for 1st gen
- // If the current base is in "far future", it's assumed to result from
- // clock change and the base is updated, too.
+ // If the current base is in "far-future", it's assumed to result
+ // from clock change and the base is updated, too.
now -= 6;
result = ts_bases_.getCurrentBase(now);
EXPECT_EQ(now, result.first);
@@ -97,6 +99,7 @@ TEST_F(RRLTimestampsTest, getCurrentBase) {
EXPECT_EQ(4195, ts_bases_.getBaseByGen(1));
EXPECT_EQ(4195 - 6, ts_bases_.getBaseByGen(2));
EXPECT_EQ(4195 - 6 + 4095, ts_bases_.getBaseByGen(3));
+
// out-of-range generation will result in an exception
EXPECT_THROW(ts_bases_.getBaseByGen(4), std::out_of_range);
}
More information about the bind10-changes
mailing list