Commit cea0d105 authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[2850] Add a test for clear() on an uninitialized segment

parent 3ebd4b03
......@@ -375,6 +375,21 @@ TEST_F(ZoneTableSegmentMappedTest, resetReadOnly) {
TEST_F(ZoneTableSegmentMappedTest, clearUninitialized) {
// Clearing a segment that has not been reset() is a nop, as clear()
// returns it to a fresh uninitialized state anyway.
// The following should still throw, because the segment has not
// been successfully reset() yet.
EXPECT_THROW(ztable_segment_->getHeader(), isc::InvalidOperation);
EXPECT_THROW(ztable_segment_->getMemorySegment(), isc::InvalidOperation);
// isWritable() must still return false, because the segment has not
// been successfully reset() yet.
TEST_F(ZoneTableSegmentMappedTest, clear) {
// First, open an underlying mapped file in read+write mode (doesn't
// exist yet)
Supports Markdown
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