diff options
author | Yves-Alexis Perez <corsac@corsac.net> | 2017-09-01 17:21:25 +0200 |
---|---|---|
committer | Yves-Alexis Perez <corsac@corsac.net> | 2017-09-01 17:21:25 +0200 |
commit | 11d6b62db969bdd808d0f56706cb18f113927a31 (patch) | |
tree | 8aa7d8fb611c3da6a3523cb78a082f62ffd0dac8 /src/libcharon/tests/utils | |
parent | bba25e2ff6c4a193acb54560ea4417537bd2954e (diff) | |
download | vyos-strongswan-11d6b62db969bdd808d0f56706cb18f113927a31.tar.gz vyos-strongswan-11d6b62db969bdd808d0f56706cb18f113927a31.zip |
New upstream version 5.6.0
Diffstat (limited to 'src/libcharon/tests/utils')
-rw-r--r-- | src/libcharon/tests/utils/exchange_test_asserts.h | 12 | ||||
-rw-r--r-- | src/libcharon/tests/utils/sa_asserts.h | 3 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src/libcharon/tests/utils/exchange_test_asserts.h b/src/libcharon/tests/utils/exchange_test_asserts.h index 4d363edfd..ae9ac5c98 100644 --- a/src/libcharon/tests/utils/exchange_test_asserts.h +++ b/src/libcharon/tests/utils/exchange_test_asserts.h @@ -285,7 +285,7 @@ bool exchange_test_asserts_message(listener_t *this, ike_sa_t *ike_sa, * @param dir IN or OUT to check the next in- or outbound message */ #define assert_message_empty(dir) \ - _assert_payload(dir, 0) + _assert_payload(#dir, 0) /** * Assert that the next in- or outbound plaintext message contains exactly @@ -295,7 +295,7 @@ bool exchange_test_asserts_message(listener_t *this, ike_sa_t *ike_sa, * @param expected expected payload type */ #define assert_single_payload(dir, expected) \ - _assert_payload(dir, 1, { TRUE, expected, 0 }) + _assert_payload(#dir, 1, { TRUE, expected, 0 }) /** * Assert that the next in- or outbound plaintext message contains exactly @@ -305,7 +305,7 @@ bool exchange_test_asserts_message(listener_t *this, ike_sa_t *ike_sa, * @param expected expected notify type */ #define assert_single_notify(dir, expected) \ - _assert_payload(dir, 1, { TRUE, 0, expected }) + _assert_payload(#dir, 1, { TRUE, 0, expected }) /** * Assert that the next in- or outbound plaintext message contains a notify @@ -315,7 +315,7 @@ bool exchange_test_asserts_message(listener_t *this, ike_sa_t *ike_sa, * @param expected expected notify type */ #define assert_notify(dir, expected) \ - _assert_payload(dir, -1, { TRUE, 0, expected }) + _assert_payload(#dir, -1, { TRUE, 0, expected }) /** * Assert that the next in- or outbound plaintext message does not contain a @@ -325,7 +325,7 @@ bool exchange_test_asserts_message(listener_t *this, ike_sa_t *ike_sa, * @param unexpected not expected notify type */ #define assert_no_notify(dir, unexpected) \ - _assert_payload(dir, -1, { FALSE, 0, unexpected }) + _assert_payload(#dir, -1, { FALSE, 0, unexpected }) #define _assert_payload(dir, c, ...) ({ \ listener_message_rule_t _rules[] = { __VA_ARGS__ }; \ @@ -333,7 +333,7 @@ bool exchange_test_asserts_message(listener_t *this, ike_sa_t *ike_sa, .listener = { .message = exchange_test_asserts_message, }, \ .file = __FILE__, \ .line = __LINE__, \ - .incoming = streq(#dir, "IN") ? TRUE : FALSE, \ + .incoming = streq(dir, "IN") ? TRUE : FALSE, \ .count = c, \ .rules = _rules, \ .num_rules = countof(_rules), \ diff --git a/src/libcharon/tests/utils/sa_asserts.h b/src/libcharon/tests/utils/sa_asserts.h index d23f724f1..216c15065 100644 --- a/src/libcharon/tests/utils/sa_asserts.h +++ b/src/libcharon/tests/utils/sa_asserts.h @@ -121,7 +121,8 @@ test_assert_msg(_state == _child->get_state(_child), "%N != %N", \ child_sa_state_names, _state, \ child_sa_state_names, _child->get_state(_child)); \ - test_assert_msg(_outbound == _child->get_outbound_state(_child), "%N != %N", \ + typeof(outbound) _cur_out = _child->get_outbound_state(_child); \ + test_assert_msg(_outbound == _cur_out || _outbound & _cur_out, "%N != %N", \ child_sa_outbound_state_names, _outbound, \ child_sa_outbound_state_names, _child->get_outbound_state(_child)); \ }) |