forked from nachaphon-phontree/TrustTunnelClient
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_fsm.cpp
More file actions
33 lines (23 loc) · 717 Bytes
/
test_fsm.cpp
File metadata and controls
33 lines (23 loc) · 717 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <gtest/gtest.h>
#include "vpn/fsm.h"
#ifndef NDEBUG
using namespace ag;
static bool dummy_condition(const void *, void *) {
return true;
}
static void dummy_action(void *, void *) {
}
TEST(FSMValidation, TargetStateAnyState) {
FsmTransitionTable transition_table = {
{0, 0, dummy_condition, dummy_action, Fsm::ANY_SOURCE_STATE},
};
ASSERT_FALSE(Fsm::validate_transition_table(transition_table));
}
TEST(FSMValidation, Closed) {
FsmTransitionTable transition_table = {
{0, 0, Fsm::ANYWAY, dummy_action, 0},
{0, 0, dummy_condition, dummy_action, 0},
};
ASSERT_FALSE(Fsm::validate_transition_table(transition_table));
}
#endif // NDEBUG