forked from boostorg/mqtt5
(Un)subscribe validates the number of topics and reason codes
Test Plan: related to T12015 - (un)subscribe reason codes will always contain as many reason codes as there are topic filters - if, by some odd chance, the client receives the wrong number of rcs or some are invalid, it will treat it as malformed - both subscribe_op and unsubscribe_op should be 100% covered by tests now Reviewers: ivica Reviewed By: ivica Subscribers: miljen, iljazovic Differential Revision: https://repo.mireo.local/D27592
This commit is contained in:
1 parent
4bf59cc18c
commit
d6c4884d53
10 files changed
+405
-81
No files matched your search
@@ -100,7 +100,7 @@ void setup_cancel_op_test_case(
|
||||
|
||||
template <
|
||||
test::operation_type op_type,
|
||||
std::enable_if_t<op_type == test::operation_type::subscribe, bool > = true
|
||||
std::enable_if_t<op_type == test::operation_type::unsubscribe, bool > = true
|
||||
>
|
||||
void setup_cancel_op_test_case(
|
||||
client_type& c, asio::cancellation_signal& signal, int& handlers_called
|
||||
@@ -115,9 +115,8 @@ void setup_cancel_op_test_case(
|
||||
) {
|
||||
handlers_called++;
|
||||
BOOST_CHECK_EQUAL(ec, asio::error::operation_aborted);
|
||||
// TODO: be consistent with complete_post
|
||||
//BOOST_ASSERT(rcs.size() == 1);
|
||||
//BOOST_CHECK(rcs[0] == reason_codes::empty);
|
||||
BOOST_ASSERT(rcs.size() == 1);
|
||||
BOOST_CHECK(rcs[0] == reason_codes::empty);
|
||||
}
|
||||
)
|
||||
);
|
||||
@@ -125,7 +124,7 @@ void setup_cancel_op_test_case(
|
||||
|
||||
template <
|
||||
test::operation_type op_type,
|
||||
std::enable_if_t<op_type == test::operation_type::unsubscribe, bool> = true
|
||||
std::enable_if_t<op_type == test::operation_type::subscribe, bool> = true
|
||||
>
|
||||
void setup_cancel_op_test_case(
|
||||
client_type& c, asio::cancellation_signal& signal, int& handlers_called
|
||||
@@ -140,9 +139,8 @@ void setup_cancel_op_test_case(
|
||||
) {
|
||||
handlers_called++;
|
||||
BOOST_CHECK_EQUAL(ec, asio::error::operation_aborted);
|
||||
// TODO: be consistent with complete_post
|
||||
//BOOST_ASSERT(rcs.size() == 1);
|
||||
//BOOST_CHECK(rcs[0] == reason_codes::empty);
|
||||
BOOST_ASSERT(rcs.size() == 1);
|
||||
BOOST_CHECK(rcs[0] == reason_codes::empty);
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user