Commit 403c7178 authored by Jeremy C. Reed's avatar Jeremy C. Reed
Browse files

[master] fix regression in MasterLoaderTest

I introduced problem by fixing a typo in a comment in a zone file.
The character positions or file sizes of the file were hardcoded
in the unit test. I had seen the failure on my system but didn't
associate it. (My mistake for not looking closely.)

The typo fix added one character so changed the hardcoded 549 to 500
and 506 to 507.

(Later maybe some macros should be used for this?)
parent 68863a78
......@@ -167,8 +167,8 @@ TEST_F(MasterLoaderTest, basicLoad) {
// Hardcode expected values taken from the test data file, assuming it
// won't change too often.
EXPECT_EQ(549, loader_->getSize());
EXPECT_EQ(549, loader_->getPosition());
EXPECT_EQ(550, loader_->getSize());
EXPECT_EQ(550, loader_->getPosition());
checkBasicRRs();
}
......@@ -227,20 +227,20 @@ TEST_F(MasterLoaderTest, includeAndIncremental) {
EXPECT_EQ(zone_data.size(), loader_->getSize());
EXPECT_EQ(first_rr.size(), loader_->getPosition());
// Read next 4. It includes $INCLUDE processing. Magic number of 549
// is the size of the test zone file (see above); 506 is the position in
// Read next 4. It includes $INCLUDE processing. Magic number of 550
// is the size of the test zone file (see above); 507 is the position in
// the file at the end of 4th RR (due to extra comments it's smaller than
// the file size).
loader_->loadIncremental(4);
EXPECT_EQ(zone_data.size() + 549, loader_->getSize());
EXPECT_EQ(first_rr.size() + include_str.size() + 506,
EXPECT_EQ(zone_data.size() + 550, loader_->getSize());
EXPECT_EQ(first_rr.size() + include_str.size() + 507,
loader_->getPosition());
// Read the last one. At this point getSize and getPosition return
// the same value, indicating progress of 100%.
loader_->loadIncremental(1);
EXPECT_EQ(zone_data.size() + 549, loader_->getSize());
EXPECT_EQ(zone_data.size() + 549, loader_->getPosition());
EXPECT_EQ(zone_data.size() + 550, loader_->getSize());
EXPECT_EQ(zone_data.size() + 550, loader_->getPosition());
// we were not interested in checking RRs in this test. clear them to
// not confuse TearDown().
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment