forked from boostorg/mqtt5
Fix MSVC warning and test fail.
Reviewers: korina Reviewed By: korina Differential Revision: https://repo.mireo.local/D28583
This commit is contained in:
@ -26,6 +26,7 @@ struct shared_test_data {
|
|||||||
const std::string connack = encoders::encode_connack(
|
const std::string connack = encoders::encode_connack(
|
||||||
false, reason_codes::success.value(), {}
|
false, reason_codes::success.value(), {}
|
||||||
);
|
);
|
||||||
|
std::string connack_rm;
|
||||||
|
|
||||||
const std::string publish_qos1 = encoders::encode_publish(
|
const std::string publish_qos1 = encoders::encode_publish(
|
||||||
1, topic, payload, qos_e::at_least_once, retain_e::no, dup_e::no, {}
|
1, topic, payload, qos_e::at_least_once, retain_e::no, dup_e::no, {}
|
||||||
@ -35,6 +36,15 @@ struct shared_test_data {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const std::string puback = encoders::encode_puback(1, uint8_t(0x00), {});
|
const std::string puback = encoders::encode_puback(1, uint8_t(0x00), {});
|
||||||
|
|
||||||
|
shared_test_data() {
|
||||||
|
connack_props props;
|
||||||
|
props[prop::receive_maximum] = uint16_t(1);
|
||||||
|
|
||||||
|
connack_rm = encoders::encode_connack(
|
||||||
|
false, reason_codes::success.value(), props
|
||||||
|
);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
using test::after;
|
using test::after;
|
||||||
@ -144,7 +154,7 @@ BOOST_FIXTURE_TEST_CASE(sub_unsub_ordering_after_reconnect, shared_test_data) {
|
|||||||
.reply_with(connack, after(2ms))
|
.reply_with(connack, after(2ms))
|
||||||
.expect(subscribe, unsubscribe)
|
.expect(subscribe, unsubscribe)
|
||||||
.complete_with(success, after(1ms))
|
.complete_with(success, after(1ms))
|
||||||
.send(disconnect, after(5ms))
|
.send(disconnect, after(50ms))
|
||||||
.expect(connect)
|
.expect(connect)
|
||||||
.complete_with(success, after(1ms))
|
.complete_with(success, after(1ms))
|
||||||
.reply_with(connack, after(2ms))
|
.reply_with(connack, after(2ms))
|
||||||
@ -195,14 +205,7 @@ BOOST_FIXTURE_TEST_CASE(throttling, shared_test_data) {
|
|||||||
constexpr int expected_handlers_called = 3;
|
constexpr int expected_handlers_called = 3;
|
||||||
int handlers_called = 0;
|
int handlers_called = 0;
|
||||||
|
|
||||||
connack_props props;
|
// packets
|
||||||
props[prop::receive_maximum] = uint16_t(1);
|
|
||||||
|
|
||||||
//packets
|
|
||||||
auto connack_rm = encoders::encode_connack(
|
|
||||||
false, reason_codes::success.value(), props
|
|
||||||
);
|
|
||||||
|
|
||||||
auto publish_1 = encoders::encode_publish(
|
auto publish_1 = encoders::encode_publish(
|
||||||
1, topic, payload, qos_e::at_least_once, retain_e::no, dup_e::no, {}
|
1, topic, payload, qos_e::at_least_once, retain_e::no, dup_e::no, {}
|
||||||
);
|
);
|
||||||
@ -268,11 +271,6 @@ BOOST_FIXTURE_TEST_CASE(throttling_ordering, shared_test_data) {
|
|||||||
int handlers_called = 0;
|
int handlers_called = 0;
|
||||||
|
|
||||||
// packets
|
// packets
|
||||||
connack_props props;
|
|
||||||
props[prop::receive_maximum] = 2;
|
|
||||||
const std::string connack = encoders::encode_connack(
|
|
||||||
false, reason_codes::success.value(), props
|
|
||||||
);
|
|
||||||
auto publish_qos0 = encoders::encode_publish(
|
auto publish_qos0 = encoders::encode_publish(
|
||||||
0, topic, payload, qos_e::at_most_once, retain_e::no, dup_e::no, {}
|
0, topic, payload, qos_e::at_most_once, retain_e::no, dup_e::no, {}
|
||||||
);
|
);
|
||||||
|
@ -134,7 +134,7 @@ BOOST_FIXTURE_TEST_CASE(receive_disconnect, shared_test_data) {
|
|||||||
.expect(connect)
|
.expect(connect)
|
||||||
.complete_with(success, after(0ms))
|
.complete_with(success, after(0ms))
|
||||||
.reply_with(connack, after(0ms))
|
.reply_with(connack, after(0ms))
|
||||||
.send(disconnect, after(5ms))
|
.send(disconnect, after(50ms))
|
||||||
.expect(connect)
|
.expect(connect)
|
||||||
.complete_with(success, after(0ms))
|
.complete_with(success, after(0ms))
|
||||||
.reply_with(connack, after(0ms));
|
.reply_with(connack, after(0ms));
|
||||||
|
Reference in New Issue
Block a user