Skip to content

Commit e79eaef

Browse files
committed
[test] Check snapshot timestamp
1 parent aae6316 commit e79eaef

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/test_base_snapshot.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -151,4 +151,15 @@ TEST_F(TestBaseSnapshot, retrieves_parents_properties)
151151
EXPECT_EQ(child.get_parents_index(), parent_index);
152152
EXPECT_EQ(child.get_parents_name(), parent_name);
153153
}
154+
155+
TEST_F(TestBaseSnapshot, adopts_current_timestamp)
156+
{
157+
auto before = QDateTime::currentDateTimeUtc();
158+
auto snapshot = MockBaseSnapshot{"foo", "", nullptr, specs, vm};
159+
auto after = QDateTime::currentDateTimeUtc();
160+
161+
EXPECT_GE(snapshot.get_creation_timestamp(), before);
162+
EXPECT_LE(snapshot.get_creation_timestamp(), after);
163+
}
164+
154165
} // namespace

0 commit comments

Comments
 (0)