Lifecycle refactor (#298)
* no static initialization of states anymore * make transition labels more descriptive * introduce labeled keys * define default transition keys * fix memory management * introduce service for transition graph * export transition keys * remove keys, transition id unique, label ambiguous * semicolon for macro call
This commit is contained in:
parent
9d4b1c9912
commit
5e3d4be720
13 changed files with 933 additions and 659 deletions
|
@ -26,8 +26,7 @@
|
|||
#include "rcl/rcl.h"
|
||||
|
||||
#include "rcl_lifecycle/rcl_lifecycle.h"
|
||||
|
||||
#include "../src/default_state_machine.h"
|
||||
#include "rcl_lifecycle/default_state_machine.h"
|
||||
|
||||
class TestMultipleInstances : public ::testing::Test
|
||||
{
|
||||
|
@ -62,15 +61,15 @@ protected:
|
|||
void
|
||||
test_trigger_transition(
|
||||
rcl_lifecycle_state_machine_t * state_machine,
|
||||
int key,
|
||||
uint8_t key_id,
|
||||
unsigned int expected_current_state,
|
||||
unsigned int expected_goal_state)
|
||||
{
|
||||
EXPECT_EQ(
|
||||
expected_current_state, state_machine->current_state->id);
|
||||
EXPECT_EQ(
|
||||
RCL_RET_OK, rcl_lifecycle_trigger_transition(
|
||||
state_machine, key, false));
|
||||
RCL_RET_OK, rcl_lifecycle_trigger_transition_by_id(
|
||||
state_machine, key_id, false));
|
||||
EXPECT_EQ(
|
||||
expected_goal_state, state_machine->current_state->id);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue