Skip to content

Commit

Permalink
[test] Check parent properties
Browse files Browse the repository at this point in the history
  • Loading branch information
ricab committed Oct 23, 2023
1 parent 7b5504e commit 20b8f3b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_base_snapshot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,18 @@ TEST_F(TestBaseSnapshot, adopts_next_index)
auto snapshot = MockBaseSnapshot{"tau", "ceti", nullptr, specs, vm};
EXPECT_EQ(snapshot.get_index(), count + 1);
}

TEST_F(TestBaseSnapshot, retrieves_parents_properties)
{
int parent_index = 11;
std::string parent_name = "parent";

EXPECT_CALL(vm, get_snapshot_count).WillOnce(Return(parent_index - 1)).WillOnce(Return(31));

auto parent = std::make_shared<MockBaseSnapshot>(parent_name, "", nullptr, specs, vm);

auto child = MockBaseSnapshot{"child", "", parent, specs, vm};
EXPECT_EQ(child.get_parents_index(), parent_index);
EXPECT_EQ(child.get_parents_name(), parent_name);
}
} // namespace

0 comments on commit 20b8f3b

Please sign in to comment.