Fix Win32 build

Summary: related to T11798

Reviewers: ivica

Reviewed By: ivica

Subscribers: miljen, iljazovic

Differential Revision: https://repo.mireo.local/D27668
This commit is contained in:
Korina Šimičević
2024-02-01 13:10:09 +01:00
parent e143fcce63
commit 46a48fb62c
3 changed files with 15 additions and 18 deletions

View File

@ -162,8 +162,6 @@ public:
to_readable_packet(std::string((const char*)it->data(), it->size()))
)
);
else
log(to_readable_packet(expected[i]));
}
} else
BOOST_CHECK_MESSAGE(

View File

@ -43,7 +43,6 @@ struct shared_test_data {
const std::string publish_qos2 = encoders::encode_publish(
1, topic, payload, qos_e::exactly_once, retain_e::no, dup_e::no, {}
);
const std::string big_publish = encode_big_publish();
const std::string puback = encoders::encode_puback(1, uint8_t(0x00), {});
@ -55,21 +54,9 @@ struct shared_test_data {
private:
connect_props allow_big_packets_cprops() {
connect_props c_props;
c_props[prop::maximum_packet_size] = std::numeric_limits<int32_t>::max();
c_props[prop::maximum_packet_size] = 10'000'000;
return c_props;
}
std::string encode_big_publish() {
publish_props big_props;
for (int i = 0; i < 100; i++)
big_props[prop::user_property].push_back(std::string(65534, 'u'));
return encoders::encode_publish(
1, topic, payload,
qos_e::at_most_once, retain_e::no, dup_e::no,
std::move(big_props)
);
}
};
using test::after;
@ -315,6 +302,18 @@ BOOST_FIXTURE_TEST_CASE(receive_big_publish, shared_test_data) {
const int expected_handlers_called = 1;
int handlers_called = 0;
// data
publish_props big_props;
for (int i = 0; i < 100; i++)
big_props[prop::user_property].push_back(std::string(65534, 'u'));
// packets
auto big_publish = encoders::encode_publish(
1, topic, payload,
qos_e::at_most_once, retain_e::no, dup_e::no,
std::move(big_props)
);
test::msg_exchange broker_side;
broker_side
.expect(connect_with_cprops)
@ -342,7 +341,7 @@ BOOST_FIXTURE_TEST_CASE(receive_big_publish, shared_test_data) {
BOOST_TEST(!ec);
BOOST_TEST(topic == topic_);
BOOST_TEST(payload == payload_);
BOOST_TEST(pprops[prop::user_property].size() == 100);
BOOST_TEST(pprops[prop::user_property].size() == 100u);
c.cancel();
});

View File

@ -416,7 +416,7 @@ BOOST_FIXTURE_TEST_CASE(send_big_publish, shared_test_data) {
std::vector<std::string> buffers;
for (size_t i = 0; i < big_publish.size(); i += 65536)
buffers.push_back(big_publish.substr(i, 65536));
BOOST_TEST_REQUIRE(buffers.size() == 3);
BOOST_TEST_REQUIRE(buffers.size() == 3u);
// this single async_send will result in 3 calls to async_write_some in our stream
test::msg_exchange broker_side;