改造一些
This commit is contained in:
@@ -164,6 +164,18 @@ TEST(scene_base_test, setting_same_topology_parent_is_a_noop) {
|
||||
}
|
||||
EXPECT_TRUE(found);
|
||||
}
|
||||
TEST(scene_base_test, display_graph_rejects_cycles) {
|
||||
Scene2D_Context<> scene;
|
||||
auto first = std::make_shared<Scene_Base_Test_Renderable>(scene);
|
||||
auto second = std::make_shared<Scene_Base_Test_Renderable>(scene);
|
||||
auto third = std::make_shared<Scene_Base_Test_Renderable>(scene);
|
||||
scene.attach_renderable(first);
|
||||
scene.attach_renderable(second);
|
||||
scene.attach_renderable(third);
|
||||
scene.set_display_parent(*second, first.get());
|
||||
scene.add_display_parent(*third, *second);
|
||||
EXPECT_THROW(scene.add_display_parent(*first, *third), std::invalid_argument);
|
||||
}
|
||||
TEST(scene_base_test, topology_snapshot_retains_renderable_lifetime) {
|
||||
Scene2D_Context<> scene;
|
||||
auto renderable = std::make_shared<Scene_Base_Test_Renderable>(scene);
|
||||
|
||||
Reference in New Issue
Block a user