Enable tests

Adapt test results FallbacksFixturePropagate.computeFirstSuccessfulStagePerSolutionOnly
due to 2e63c154aa:

The order of computations has changed, because we lock the processed state
as soon as it is forwarded to the first fallback child.

In this case, after processing GEN1 und FWD1 once, we have the two states with costs 2, 4 in the queue.
The first one, i.e. with cost 2 is forwarded to the child FWD2, which fails.
In the next cycle, although we have new states in the queue (1, 2, 3, 4), we stick with state "2"
and forward it two FWD3, which adds costs 210, resulting in 212.

With previous code, the Fallback container switched to state "1", forwarded to FWD2.
This commit is contained in:
Robert Haschke 2021-11-22 01:47:56 +01:00
parent 2e63c154aa
commit a0bc0602e8

View File

@ -67,7 +67,7 @@ TEST_F(FallbacksFixturePropagate, computeFirstSuccessfulStageOnly) {
EXPECT_EQ(t.numSolutions(), 1u);
}
TEST_F(FallbacksFixturePropagate, DISABLED_ComputeFirstSuccessfulStagePerSolutionOnly) {
TEST_F(FallbacksFixturePropagate, computeFirstSuccessfulStagePerSolutionOnly) {
t.add(std::make_unique<GeneratorMockup>(PredefinedCosts({ 2.0, 1.0 })));
// duplicate generator solutions with resulting costs: 4, 2 | 3, 1
t.add(std::make_unique<ForwardMockup>(PredefinedCosts({ 2.0, 0.0, 2.0, 0.0 }), 2));
@ -78,10 +78,11 @@ TEST_F(FallbacksFixturePropagate, DISABLED_ComputeFirstSuccessfulStagePerSolutio
t.add(std::move(fallbacks));
EXPECT_TRUE(t.plan());
EXPECT_COSTS(t.solutions(), testing::ElementsAre(113, 124, 211, 222));
EXPECT_COSTS(t.solutions(), testing::ElementsAre(113, 124, 212, 221));
}
TEST_F(FallbacksFixturePropagate, DISABLED_UpdateSolutionOrder) {
// requires individual job control in Fallbacks's children
TEST_F(FallbacksFixturePropagate, DISABLED_updateSolutionOrder) {
t.add(std::make_unique<BackwardMockup>(PredefinedCosts({ 10.0, 0.0 })));
t.add(std::make_unique<GeneratorMockup>(PredefinedCosts({ 1.0, 2.0 })));
// available solutions (sorted) in individual runs of fallbacks: 1 | 11, 2 | 2, 11
@ -100,7 +101,8 @@ TEST_F(FallbacksFixturePropagate, DISABLED_UpdateSolutionOrder) {
EXPECT_COSTS(t.solutions(), testing::ElementsAre(2)); // expecting less costly solution as result
}
TEST_F(FallbacksFixturePropagate, DISABLED_MultipleActivePendingStates) {
// requires individual job control in Fallbacks's children
TEST_F(FallbacksFixturePropagate, DISABLED_multipleActivePendingStates) {
t.add(std::make_unique<GeneratorMockup>(PredefinedCosts({ 2.0, 1.0, 3.0 })));
// use a fallback container to delay computation: the 1st child never succeeds, but only the 2nd
auto inner = std::make_unique<Fallbacks>("Inner");
@ -159,7 +161,7 @@ TEST_F(FallbacksFixturePropagate, activeChildReset) {
using FallbacksFixtureConnect = TaskTestBase;
TEST_F(FallbacksFixtureConnect, DISABLED_ConnectStageInsideFallbacks) {
TEST_F(FallbacksFixtureConnect, connectStageInsideFallbacks) {
t.add(std::make_unique<GeneratorMockup>(PredefinedCosts({ 1.0, 2.0 })));
auto fallbacks = std::make_unique<Fallbacks>("Fallbacks");