Skip to content

Commit

Permalink
test_pruning.cpp: Extend test to ParallelContainer
Browse files Browse the repository at this point in the history
  • Loading branch information
rhaschke committed Jul 4, 2024
1 parent 42a08d6 commit 48bde8d
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions core/test/test_pruning.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,20 @@ TEST_F(Pruning, ConnectReactivatesPrunedPaths) {
// same as before, but wrapping Connect into a container
template <typename T>
struct PruningContainerTests : public Pruning
{
void test() {
add(t, new BackwardMockup);
add(t, new GeneratorMockup({ 0 }));
auto c = new T();
add(*c, new ConnectMockup());
add(t, c);
add(t, new GeneratorMockup({ 0 }));

EXPECT_TRUE(t.plan());
EXPECT_EQ(t.solutions().size(), 1u);
}
};
using ContainerTypes = ::testing::Types<SerialContainer>; // TODO: fails for Fallbacks!
{};

using ContainerTypes = ::testing::Types<SerialContainer, Fallbacks>;
TYPED_TEST_SUITE(PruningContainerTests, ContainerTypes);
TYPED_TEST(PruningContainerTests, ConnectReactivatesPrunedPaths) {
this->test();
this->add(this->t, new BackwardMockup);
this->add(this->t, new GeneratorMockup({ 0 }));
auto c = new TypeParam();
this->add(*c, new ConnectMockup());
this->add(this->t, c);
this->add(this->t, new GeneratorMockup({ 0 }));

EXPECT_TRUE(this->t.plan());
EXPECT_EQ(this->t.solutions().size(), 1u);
}

TEST_F(Pruning, ConnectConnectForward) {
Expand Down

0 comments on commit 48bde8d

Please sign in to comment.