Skip to content

Commit

Permalink
[test] Check snapshot timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
ricab committed Oct 25, 2023
1 parent aae6316 commit e79eaef
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_base_snapshot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,15 @@ TEST_F(TestBaseSnapshot, retrieves_parents_properties)
EXPECT_EQ(child.get_parents_index(), parent_index);
EXPECT_EQ(child.get_parents_name(), parent_name);
}

TEST_F(TestBaseSnapshot, adopts_current_timestamp)
{
auto before = QDateTime::currentDateTimeUtc();
auto snapshot = MockBaseSnapshot{"foo", "", nullptr, specs, vm};
auto after = QDateTime::currentDateTimeUtc();

EXPECT_GE(snapshot.get_creation_timestamp(), before);
EXPECT_LE(snapshot.get_creation_timestamp(), after);
}

} // namespace

0 comments on commit e79eaef

Please sign in to comment.