26 TEST_CASE(
"Action's 'make_accept' factory method constructs an ACCEPT action.",
29 SECTION(
"Without a priority.")
33 REQUIRE(result.priority() == 0);
35 SECTION(
"With a priority.")
39 REQUIRE(result.priority() == -10);
44 TEST_CASE(
"Action's 'make_reject' factory method constructs a REJECT action.",
49 REQUIRE(result.priority() == 0);
53 TEST_CASE(
"Action's 'make_continue' factory method constructs a CONTINUE " 54 "action.",
"[Action]")
58 REQUIRE(result.priority() == 0);
62 TEST_CASE(
"Action's 'make_default' factory method constructs a DEFAULT action.",
67 REQUIRE(result.priority() == 0);
71 TEST_CASE(
"Action's 'priority' method sets and gets the priority.",
74 SECTION(
"Can be set exactly once for accept results without a priority.")
77 REQUIRE(result.priority() == 0);
79 REQUIRE(result.priority() == 10);
81 REQUIRE(result.priority() == 10);
83 SECTION(
"Cannot be set for accept results with a priority.")
86 REQUIRE(result.priority() == 10);
88 REQUIRE(result.priority() == 10);
90 SECTION(
"Cannot be set on reject, continue, or default actions.")
94 REQUIRE(
reject.priority() == 0);
96 continue_.priority(10);
97 REQUIRE(continue_.priority() == 0);
99 default_.priority(10);
100 REQUIRE(default_.priority() == 0);
141 auto moved(std::move(original));
156 TEST_CASE(
"Action's are assignable (by move semantics).",
"[Action]")
static Action make_reject()
The packet has been accepted, possibly with priority.
std::string str(const T &object)
Continue evaluating rules.
static Action make_accept(std::optional< int > priority={})
static Action make_continue()
static Action make_default()
TEST_CASE("Action's 'make_accept' factory method constructs an ACCEPT action.", "[Action]")
The packet has been rejected.