Skip to content

Commit 0f1dbd8

Browse files
committed
Fixed test
1 parent bc764fe commit 0f1dbd8

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

tests/state_tree_test.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,18 @@ TEST(StateTreeTest, TransitionChangesState)
3737

3838
TEST(StateTreeTest, GuardPreventsTransition)
3939
{
40+
class NotPassGuard : public IGuard
41+
{
42+
public:
43+
bool evaluate(const std::any &context) const override
44+
{
45+
return false;
46+
}
47+
};
4048
auto machine = Builder()
4149
.initial("Idle")
4250
.state("Idle", [](State &s)
43-
{ s.on("Start", "Running", nullptr, [](const std::any &)
44-
{ return false; }); })
51+
{ s.on("Start", "Running", new NotPassGuard()); })
4552
.state("Running", [](State &s)
4653
{ s.on("Stop", "Idle"); })
4754
.build();

0 commit comments

Comments
 (0)