So remove the condition to check it. Keep an assert there, just in case
there was a reason originally, so we know about it.
}
~ZoneDataUpdaterTest() {
- if (updater_) {
- ZoneData::destroy(*mem_sgmt_, getZoneData(), zclass_);
- // Release the updater, so it frees all memory inside the segment too
- updater_.reset();
- mem_sgmt_->clearNamedAddress("Test zone data");
- }
+ assert(updater_);
+ ZoneData::destroy(*mem_sgmt_, getZoneData(), zclass_);
+ // Release the updater, so it frees all memory inside the segment too
+ updater_.reset();
+ mem_sgmt_->clearNamedAddress("Test zone data");
if (!mem_sgmt_->allMemoryDeallocated()) {
ADD_FAILURE() << "Memory leak detected";
}