jonasblixt / ufsm

Statechart library and editor
Other
357 stars 36 forks source link

example "test_do.c" : where is the mistake ? #18

Open EduardShaid opened 5 years ago

EduardShaid commented 5 years ago

I changed the file "test_do.c":

int main(void) 
{
    struct ufsm_machine *m = get_StateMachine1();

    test_init(m);
    ufsm_init_machine(m);

    assert(flag_final && flag_dA_stop);

    flag_final = false;
    call_cb = false;
    flag_dA_stop = false;
    ufsm_reset_machine(m);
    ufsm_init_machine(m);

while(1) {
    test_process(m, EV);
    assert (!flag_final && flag_dA_stop);
    }

    return 0;
}

that is, I try to constantly call test_process (m, EV) ;:

while (1) {
     test_process (m, EV);
     assert (! flag_final && flag_dA_stop);
     }

but in the process, the program goes into error (terminal output):

 EV |     OP     | Details
    | Transition |  {Init} -->  {Simple State} T=COMPLETION
    | S exit     |  {Init}
    | S enter    |  {Simple State}
    | Call       | 
    | Transition |  {Simple State} -->  {Final} T=COMPLETION
    | S exit     |  {Simple State}
    | Call       | 
    | Action     | ()
 -- | RESET      | 
    | Transition |  {Init} -->  {Simple State} T=COMPLETION
    | S exit     |  {Init}
    | S enter    |  {Simple State}
    | Call       | 
 0  |            |
    | Transition |  {Simple State} -->  {Simple State} T=EV 
    | S exit     |  {Simple State}
    | Call       | 
    | S enter    |  {Simple State}
 0  |            |
ERROR: Event not processed
 0  |            |
ERROR: Event not processed
 0  |            |
ERROR: Event not processed

Why does the error "ERROR: Event not processed" appear? All the time I am in the {Simple State} state and the EV event should be processed ?