Skip to content

Commit 4d8d32d

Browse files
committed
New test: keep previously configured propagate interface
1 parent 9116e92 commit 4d8d32d

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

core/test/test_container.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,30 @@ TEST_F(SerialTest, init_generator) {
343343
EXPECT_INIT_FAILURE(true, true, GEN, GEN); // two generator stages cannot be connected
344344
}
345345

346+
TEST_F(SerialTest, keep_configured_propagator_interface) {
347+
// configuring an ANY propagator should work
348+
EXPECT_INIT_SUCCESS(false, true, ANY);
349+
EXPECT_EQ(container.pimpl()->children().front()->pimpl()->requiredInterface(), InterfaceFlags(PROPAGATE_FORWARDS));
350+
351+
// multiple times
352+
validateInit(false, true, false);
353+
EXPECT_EQ(container.pimpl()->children().front()->pimpl()->requiredInterface(), InterfaceFlags(PROPAGATE_FORWARDS));
354+
// and with another interface direction as well
355+
validateInit(true, false, false);
356+
EXPECT_EQ(container.pimpl()->children().front()->pimpl()->requiredInterface(), InterfaceFlags(PROPAGATE_BACKWARDS));
357+
358+
// configuring a FORWARD propagator should work in forward direction
359+
EXPECT_INIT_SUCCESS(false, true, FW);
360+
// but fail when initialized in backward direction
361+
validateInit(true, false, true);
362+
EXPECT_EQ(container.pimpl()->children().front()->pimpl()->requiredInterface(), InterfaceFlags(PROPAGATE_FORWARDS));
363+
364+
// same with BACKWARD propagator
365+
EXPECT_INIT_SUCCESS(true, false, BW);
366+
validateInit(false, true, true);
367+
EXPECT_EQ(container.pimpl()->children().front()->pimpl()->requiredInterface(), InterfaceFlags(PROPAGATE_BACKWARDS));
368+
}
369+
346370
TEST_F(SerialTest, init_forward) {
347371
// container interface doesn't match children
348372
EXPECT_INIT_FAILURE(false, false, FW);

0 commit comments

Comments
 (0)