Commit 78dfd7dc authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[2268] Move both const and non-const checks into a single testcase

parent 47c013b0
......@@ -55,24 +55,23 @@ TEST_F(ZoneTableSegmentTest, create) {
// Helper function to check const and non-const methods.
template <typename TS, typename TH>
template <typename TS, typename TH, typename TT>
testGetHeader(ZoneTableSegment* segment) {
TH& header = static_cast<TS*>(segment)->getHeader();
// The zone table is unset.
const ZoneTable* table = header.getTable();
TT* table = header.getTable();
EXPECT_EQ(static_cast<void*>(NULL), table);
TEST_F(ZoneTableSegmentTest, getHeader) {
// non-const version.
testGetHeader<ZoneTableSegment, ZoneTableHeader>(segment_);
testGetHeader<ZoneTableSegment, ZoneTableHeader, ZoneTable>(segment_);
TEST_F(ZoneTableSegmentTest, getHeaderConst) {
// const version.
testGetHeader<const ZoneTableSegment, const ZoneTableHeader>(segment_);
testGetHeader<const ZoneTableSegment, const ZoneTableHeader,
const ZoneTable>(segment_);
TEST_F(ZoneTableSegmentTest, getMemorySegment) {
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