@@ -79,20 +79,27 @@ TEST(ContainerBase, positionForInsert) {
7979
8080/* TODO: remove interface as it returns raw pointers */
8181TEST (ContainerBase, findChild) {
82- SerialContainer s ;
82+ auto s = std::make_unique<SerialContainer>() ;
8383 Stage *a, *b, *c1, *d;
84- s. add (Stage::pointer (a = new NamedStage (" a" )));
85- s. add (Stage::pointer (b = new NamedStage (" b" )));
86- s. add (Stage::pointer (c1 = new NamedStage (" c" )));
84+ s-> add (Stage::pointer (a = new NamedStage (" a" )));
85+ s-> add (Stage::pointer (b = new NamedStage (" b" )));
86+ s-> add (Stage::pointer (c1 = new NamedStage (" c" )));
8787 auto sub = ContainerBase::pointer (new SerialContainer (" c" ));
8888 sub->add (Stage::pointer (d = new NamedStage (" d" )));
89- s.add (std::move (sub));
90-
91- EXPECT_EQ (s.findChild (" a" ), a);
92- EXPECT_EQ (s.findChild (" b" ), b);
93- EXPECT_EQ (s.findChild (" c" ), c1);
94- EXPECT_EQ (s.findChild (" d" ), nullptr );
95- EXPECT_EQ (s.findChild (" c/d" ), d);
89+ s->add (std::move (sub));
90+
91+ EXPECT_EQ (s->findChild (" a" ), a);
92+ EXPECT_EQ (s->findChild (" b" ), b);
93+ EXPECT_EQ (s->findChild (" c" ), c1);
94+ EXPECT_EQ (s->findChild (" d" ), nullptr );
95+ EXPECT_EQ (s->findChild (" c/d" ), d);
96+
97+ Task t (" " , false , std::move (s));
98+ EXPECT_EQ (t.findChild (" a" ), a);
99+ EXPECT_EQ (t.findChild (" b" ), b);
100+ EXPECT_EQ (t.findChild (" c" ), c1);
101+ EXPECT_EQ (t.findChild (" d" ), nullptr );
102+ EXPECT_EQ (t.findChild (" c/d" ), d);
96103}
97104
98105template <typename Container>
0 commit comments