/// impossible to predict how this class is used (to see if it's a very
/// rare case where propagating an exception from a destructor is
/// justified). Instead, the application needs to make sure that
- /// \c finish() is called before the object of this class is destroyed.
+ /// \c flush() is called before the object of this class is destroyed.
///
/// \throw None
~RRCollator();
///
/// It propagates any exception thrown from the callback; otherwise it
/// doesn't throw anything.
- void finish();
+ void flush();
/// \brief Return \c MasterLoader compatible callback.
///
rdatas_);
// Tell the collator we are done, then we'll see the last RR as an RRset.
- collator_.finish();
+ collator_.flush();
checkRRset(Name("txt.example.com"), RRClass::CH(), RRType::TXT(), rrttl_,
rdatas_);
- // Redundant finish() will be no-op.
- collator_.finish();
+ // Redundant flush() will be no-op.
+ collator_.flush();
EXPECT_TRUE(rrsets_.empty());
}
rr_callback_(origin_, rrclass_, RRType::A(), RRTTL(20), a_rdata2_);
rdatas_.push_back(a_rdata1_);
rdatas_.push_back(a_rdata2_);
- collator_.finish();
+ collator_.flush();
checkRRset(origin_, rrclass_, RRType::A(), RRTTL(10), rdatas_);
}
rr_callback_(origin_, rrclass_, RRType::A(), RRTTL(10), a_rdata2_);
rdatas_.push_back(a_rdata1_);
rdatas_.push_back(a_rdata2_);
- collator_.finish();
+ collator_.flush();
checkRRset(origin_, rrclass_, RRType::A(), RRTTL(10), rdatas_);
}
checkRRset(origin_, rrclass_, RRType::RRSIG(), rrttl_, rdatas_);
}
-TEST_F(RRCollatorTest, emptyFinish) {
- collator_.finish();
+TEST_F(RRCollatorTest, emptyFlush) {
+ collator_.flush();
EXPECT_TRUE(rrsets_.empty());
}
// We'll only see the A RR.
throw_from_callback_ = false;
- collator_.finish();
+ collator_.flush();
rdatas_.push_back(a_rdata1_);
checkRRset(origin_, rrclass_, RRType::A(), rrttl_, rdatas_);
}
MasterLoaderCallbacks::getNullCallbacks(),
collator_.getCallback());
loader.load();
- collator_.finish();
+ collator_.flush();
rdatas_.push_back(a_rdata1_);
checkRRset(origin_, rrclass_, RRType::A(), rrttl_, rdatas_);
}