#include "ut/ut.h"
#include "lib/ub.h"
#include "lib/time.h"
#include "lib/errno.h"
#include "lib/arith.h"
#include "lib/misc.h"
#include "lib/thread.h"
#include "sm/sm.h"
Go to the source code of this file.
|
enum | {
C_INIT,
C_FLIP,
C_HEAD,
C_TAIL,
C_DONE,
C_OVER,
C_WIN,
C_LOSE,
C_TIE,
C_NR
} |
|
enum | {
S_TMO_INITIAL,
S_TMO_0,
S_TMO_1,
S_TMO_2,
S_TMO_TERMINAL,
S_TMO_NR
} |
|
enum | {
S_INITIAL,
S_ITERATE,
S_FRATRICIDE,
S_TERMINAL,
S_NR
} |
|
enum | { NR_RUNS = 20
} |
|
◆ anonymous enum
Enumerator |
---|
C_INIT | |
C_FLIP | |
C_HEAD | |
C_TAIL | |
C_DONE | |
C_OVER | |
C_WIN | |
C_LOSE | |
C_TIE | |
C_NR | |
Definition at line 39 of file sm.c.
◆ anonymous enum
Unit test for m0_sm_timeout_arm().
Enumerator |
---|
S_TMO_INITIAL | |
S_TMO_0 | |
S_TMO_1 | |
S_TMO_2 | |
S_TMO_TERMINAL | |
S_TMO_NR | |
Definition at line 235 of file sm.c.
◆ anonymous enum
Enumerator |
---|
S_INITIAL | |
S_ITERATE | |
S_FRATRICIDE | |
S_TERMINAL | |
S_NR | |
Definition at line 362 of file sm.c.
◆ anonymous enum
Definition at line 587 of file sm.c.
◆ ast_cb()
Definition at line 170 of file sm.c.
◆ ast_test()
static void ast_test |
( |
void |
| ) |
|
|
static |
◆ ast_thread()
static void ast_thread |
( |
int |
__d | ) |
|
|
static |
Definition at line 46 of file sm.c.
◆ ast_wait()
static void ast_wait |
( |
void |
| ) |
|
|
static |
Definition at line 627 of file sm.c.
◆ ast_wait_cb()
Definition at line 619 of file sm.c.
◆ chain()
static void chain |
( |
void |
| ) |
|
|
static |
Definition at line 595 of file sm.c.
◆ fini()
Definition at line 68 of file sm.c.
◆ flip()
static int flip |
( |
struct m0_sm * |
mach | ) |
|
|
static |
Definition at line 461 of file sm.c.
◆ genesis_4_8()
static int genesis_4_8 |
( |
struct m0_sm * |
mach | ) |
|
|
static |
Definition at line 364 of file sm.c.
◆ group()
static void group |
( |
void |
| ) |
|
|
static |
Unit test for multiple machines in the group.
Definition at line 386 of file sm.c.
◆ head()
static int head |
( |
struct m0_sm * |
mach | ) |
|
|
static |
Definition at line 468 of file sm.c.
◆ init()
Definition at line 56 of file sm.c.
◆ over()
static int over |
( |
struct m0_sm * |
mach | ) |
|
|
static |
Definition at line 480 of file sm.c.
◆ tail()
static int tail |
( |
struct m0_sm * |
mach | ) |
|
|
static |
Definition at line 474 of file sm.c.
◆ timeout()
static void timeout |
( |
void |
| ) |
|
|
static |
Definition at line 286 of file sm.c.
◆ transition()
static void transition |
( |
void |
| ) |
|
|
static |
Unit test for m0_sm_state_set().
Performs a state transition for a very simple state machine:
Definition at line 88 of file sm.c.
◆ ast
Definition at line 35 of file sm.c.
◆ ath
Definition at line 37 of file sm.c.
◆ conf
Initial value:= {
.scf_name = "test drive: chain",
}
static struct m0_sm_state_descr states[C_NR]
Definition at line 589 of file sm.c.
Definition at line 33 of file sm.c.
◆ heads
Definition at line 42 of file sm.c.
Definition at line 34 of file sm.c.
◆ more
Definition at line 36 of file sm.c.
◆ sm_ut
Initial value:= {
.ts_name = "sm-ut",
.ts_tests = {
}
}
static void transition(void)
static void timeout(void)
static void ast_test(void)
static void ast_wait(void)
Definition at line 643 of file sm.c.
◆ states
Unit test for chained state transition incurred by ->sd_in() call-back.
Definition at line 512 of file sm.c.
◆ tails
Definition at line 43 of file sm.c.
◆ tmo_sm_conf
Initial value:= {
.scf_name = "test drive: timeout",
}
static struct m0_sm_state_descr tmo_states[S_TMO_NR]
Definition at line 280 of file sm.c.
◆ tmo_states
Definition at line 237 of file sm.c.
◆ wait
Definition at line 616 of file sm.c.
◆ wait_guard
Definition at line 617 of file sm.c.
Definition at line 168 of file sm.c.