diff --git a/.travis.yml b/.travis.yml index 869ca35a3..324d00696 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,16 +18,16 @@ matrix: include: - os: osx compiler: clang - env: FLAGS="-DMQTT_NO_TLS=ON -DMQTT_USE_WS=ON" CXXFLAGS="-std=c++14 -Werror -g -Wall -Wextra -Wno-ignored-qualifiers" MAKEFLAGS="-j2" + env: FLAGS="-DMQTT_NO_TLS=ON -DMQTT_USE_WS=ON" CXXFLAGS="-std=c++14 -Werror -g -Wall -Wextra -Wno-ignored-qualifiers -Wconversion" MAKEFLAGS="-j2" - os: osx compiler: clang - env: FLAGS="-DMQTT_NO_TLS=ON -DMQTT_USE_WS=OFF -DMQTT_USE_STR_CHECK=ON" CXXFLAGS="-std=c++17 -Werror -g -Wall -Wextra -Wno-ignored-qualifiers" MAKEFLAGS="-j2" + env: FLAGS="-DMQTT_NO_TLS=ON -DMQTT_USE_WS=OFF -DMQTT_USE_STR_CHECK=ON" CXXFLAGS="-std=c++17 -Werror -g -Wall -Wextra -Wno-ignored-qualifiers -Wconversion" MAKEFLAGS="-j2" - os: osx compiler: clang - env: FLAGS="-DMQTT_NO_TLS=OFF -DMQTT_USE_WS=OFF -DMQTT_USE_STR_CHECK=ON" CXXFLAGS="-std=c++14 -Werror -g -Wall -Wextra -Wno-ignored-qualifiers" MAKEFLAGS="-j2" + env: FLAGS="-DMQTT_NO_TLS=OFF -DMQTT_USE_WS=OFF -DMQTT_USE_STR_CHECK=ON" CXXFLAGS="-std=c++14 -Werror -g -Wall -Wextra -Wno-ignored-qualifiers -Wconversion" MAKEFLAGS="-j2" - os: linux compiler: clang - env: FLAGS="-DMQTT_NO_TLS=ON -DMQTT_USE_WS=ON -DMQTT_USE_STR_CHECK=ON" CXXFLAGS="-std=c++17 -Werror -g -Wall -Wextra -Wno-ignored-qualifiers" MAKEFLAGS="-j2" + env: FLAGS="-DMQTT_NO_TLS=ON -DMQTT_USE_WS=ON -DMQTT_USE_STR_CHECK=ON" CXXFLAGS="-std=c++17 -Werror -g -Wall -Wextra -Wno-ignored-qualifiers -Wconversion" MAKEFLAGS="-j2" addons: apt: sources: @@ -47,7 +47,7 @@ matrix: - os: linux sudo: required compiler: clang - env: FLAGS="-DMQTT_NO_TLS=OFF -DMQTT_USE_WS=ON -DMQTT_USE_STR_CHECK=ON" CFLAGS="-Werror -g -Wall -Wextra -Wno-ignored-qualifiers -fsanitize=address -fno-omit-frame-pointer" CXXFLAGS="-std=c++14 -Werror -g -Wall -Wextra -Wno-ignored-qualifiers -fsanitize=address -fno-omit-frame-pointer" LDFLAGS="-Wno-ignored-qualifiers -fsanitize=address" MAKEFLAGS="-j2" + env: FLAGS="-DMQTT_NO_TLS=OFF -DMQTT_USE_WS=ON -DMQTT_USE_STR_CHECK=ON" CFLAGS="-Werror -g -Wall -Wextra -Wno-ignored-qualifiers -fsanitize=address -fno-omit-frame-pointer" CXXFLAGS="-std=c++14 -Werror -g -Wall -Wextra -Wno-ignored-qualifiers -Wconversion -fsanitize=address -fno-omit-frame-pointer" LDFLAGS="-Wno-ignored-qualifiers -fsanitize=address" MAKEFLAGS="-j2" addons: apt: sources: @@ -67,7 +67,7 @@ matrix: - boost1.67 - os: linux compiler: gcc - env: FLAGS="-DMQTT_NO_TLS=ON -DMQTT_USE_WS=ON -DMQTT_USE_STR_CHECK=ON" CXXFLAGS="-std=c++14 -Werror -g -Wall -Wextra -Wno-ignored-qualifiers" MAKEFLAGS="-j2" + env: FLAGS="-DMQTT_NO_TLS=ON -DMQTT_USE_WS=ON -DMQTT_USE_STR_CHECK=ON" CXXFLAGS="-std=c++14 -Werror -g -Wall -Wextra -Wno-ignored-qualifiers -Wconversion" MAKEFLAGS="-j2" addons: apt: sources: @@ -84,7 +84,7 @@ matrix: - os: linux sudo: required compiler: gcc - env: FLAGS="-DMQTT_NO_TLS=OFF -DMQTT_USE_WS=OFF -DMQTT_USE_STR_CHECK=OFF" CXXFLAGS="-std=c++17 -Werror -g -Wall -Wextra -Wno-ignored-qualifiers" MAKEFLAGS="-j2" + env: FLAGS="-DMQTT_NO_TLS=OFF -DMQTT_USE_WS=OFF -DMQTT_USE_STR_CHECK=OFF" CXXFLAGS="-std=c++17 -Werror -g -Wall -Wextra -Wno-ignored-qualifiers -Wconversion" MAKEFLAGS="-j2" addons: apt: sources: diff --git a/README.md b/README.md index 68eaaf2f1..b707c7c6c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MQTT client/server for C++14 based on Boost.Asio -Version 3.1.0 [![Build Status](https://travis-ci.org/redboltz/mqtt_cpp.svg?branch=master)](https://travis-ci.org/redboltz/mqtt_cpp) [![Build status](https://ci.appveyor.com/api/projects/status/21a267hd34s0kqu5/branch/master?svg=true)](https://ci.appveyor.com/project/redboltz/mqtt-client-cpp/branch/master) +Version 4.0.0 [![Build Status](https://travis-ci.org/redboltz/mqtt_cpp.svg?branch=master)](https://travis-ci.org/redboltz/mqtt_cpp) [![Build status](https://ci.appveyor.com/api/projects/status/21a267hd34s0kqu5/branch/master?svg=true)](https://ci.appveyor.com/project/redboltz/mqtt-client-cpp/branch/master) ## Overview diff --git a/appveyor.yml b/appveyor.yml index e216898cf..1902fed16 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 3.1.0.{build} +version: 4.0.0.{build} image: Visual Studio 2017 diff --git a/include/mqtt/connect_flags.hpp b/include/mqtt/connect_flags.hpp index f205680a3..96b655ecf 100644 --- a/include/mqtt/connect_flags.hpp +++ b/include/mqtt/connect_flags.hpp @@ -40,10 +40,10 @@ inline constexpr bool has_user_name_flag(char v) { } inline void set_will_qos(char& v, std::size_t qos) { - v |= (qos & 0b00000011) << 3; + v |= static_cast((qos & 0b00000011) << 3); } -inline constexpr char will_qos(char v) { +inline constexpr std::uint8_t will_qos(char v) { return (v & 0b00011000) >> 3; } diff --git a/include/mqtt/control_packet_type.hpp b/include/mqtt/control_packet_type.hpp index ea1966cf1..84d7b29bc 100644 --- a/include/mqtt/control_packet_type.hpp +++ b/include/mqtt/control_packet_type.hpp @@ -32,8 +32,8 @@ constexpr std::uint8_t const disconnect = 14; } // namespace control_packet_type inline -constexpr std::uint8_t get_control_packet_type(char v) { - return static_cast(v) >> 4; +constexpr std::uint8_t get_control_packet_type(std::uint8_t v) { + return static_cast(v >> 4); } } // namespace mqtt diff --git a/include/mqtt/endpoint.hpp b/include/mqtt/endpoint.hpp index dc0cc4708..e30b35782 100644 --- a/include/mqtt/endpoint.hpp +++ b/include/mqtt/endpoint.hpp @@ -4079,7 +4079,7 @@ class endpoint : public std::enable_shared_from_this lck (store_mtx_); if (packet_id_.size() == std::numeric_limits::max()) throw packet_id_exhausted_error(); if (packet_id_master_ == std::numeric_limits::max()) { - packet_id_master_ = 1; + packet_id_master_ = 1U; } else { ++packet_id_master_; @@ -4092,24 +4092,24 @@ class endpoint : public std::enable_shared_from_this::max()) { - packet_id_master_ = *last + 1; + packet_id_master_ = static_cast(*last + 1U); packet_id_.insert(e, packet_id_master_); return packet_id_master_; } auto b = packet_id_.begin(); auto prev = *b; - if (prev != 1) { - packet_id_master_ = 1; + if (prev != 1U) { + packet_id_master_ = 1U; packet_id_.insert(b, packet_id_master_); return packet_id_master_; } ++b; - while (*b - 1 == prev && b != e) { + while (*b - 1U == prev && b != e) { prev = *b; ++b; } - packet_id_master_ = prev + 1; + packet_id_master_ = static_cast(prev + 1U); packet_id_.insert(b, packet_id_master_); return packet_id_master_; } @@ -4151,7 +4151,7 @@ class endpoint : public std::enable_shared_from_this(*b); switch (get_control_packet_type(fixed_header)) { case control_packet_type::publish: { auto sp = std::make_shared>(b, e); @@ -5386,7 +5386,7 @@ class endpoint : public std::enable_shared_from_this(*it)); } } if (h_suback_) return h_suback_(packet_id, std::move(results)); @@ -5992,8 +5992,10 @@ class endpoint : public std::enable_shared_from_this(b1) & 0xff)) << 8 | - (static_cast(b2) & 0xff); + static_cast( + ((static_cast(b1) & 0xff)) << 8 | + (static_cast(b2) & 0xff) + ); } struct write_completion_handler { diff --git a/include/mqtt/fixed_header.hpp b/include/mqtt/fixed_header.hpp index ac7be8482..2d61978ce 100644 --- a/include/mqtt/fixed_header.hpp +++ b/include/mqtt/fixed_header.hpp @@ -12,10 +12,10 @@ namespace mqtt { inline constexpr -char make_fixed_header(std::uint8_t type, std::uint8_t flags) { +std::uint8_t make_fixed_header(std::uint8_t type, std::uint8_t flags) { return - static_cast( - (static_cast(type) << 4) | + static_cast( + (type << 4) | (flags & 0x0f) ); } diff --git a/include/mqtt/four_byte_util.hpp b/include/mqtt/four_byte_util.hpp index ba5fbef31..eb3cece06 100644 --- a/include/mqtt/four_byte_util.hpp +++ b/include/mqtt/four_byte_util.hpp @@ -36,10 +36,12 @@ std::uint32_t make_uint32_t(It b, It e) { auto b3 = b++; auto b4 = b++; return - (static_cast(*b1) & 0xff) << 24 | - (static_cast(*b2) & 0xff) << 16 | - (static_cast(*b3) & 0xff) << 8 | - (static_cast(*b4) & 0xff); + static_cast( + (static_cast(*b1) & 0xff) << 24 | + (static_cast(*b2) & 0xff) << 16 | + (static_cast(*b3) & 0xff) << 8 | + (static_cast(*b4) & 0xff) + ); } } // namespace mqtt diff --git a/include/mqtt/message.hpp b/include/mqtt/message.hpp index 8290dfd11..f077137fe 100644 --- a/include/mqtt/message.hpp +++ b/include/mqtt/message.hpp @@ -51,7 +51,7 @@ class header_only_message { * @brief Create empty header_packet_id_message. */ header_only_message(std::uint8_t type, std::uint8_t flags) - : message_ { make_fixed_header(type, flags), 0 } + : message_ { static_cast(make_fixed_header(type, flags)), 0 } {} /** @@ -97,7 +97,7 @@ class basic_header_packet_id_message { * @brief Create empty header_packet_id_message. */ basic_header_packet_id_message(std::uint8_t type, std::uint8_t flags, typename packet_id_type::type packet_id) - : message_ { make_fixed_header(type, flags), PacketIdBytes } + : message_ { static_cast(make_fixed_header(type, flags)), PacketIdBytes } { add_packet_id_to_buf::apply(message_, packet_id); } @@ -233,7 +233,7 @@ class connack_message { public: connack_message(bool session_present, std::uint8_t return_code) : message_ { - make_fixed_header(control_packet_type::connack, 0b0000), + static_cast(make_fixed_header(control_packet_type::connack, 0b0000)), 0b0010, static_cast(session_present ? 1 : 0), static_cast(return_code) @@ -283,7 +283,7 @@ class connect_message { boost::optional const& user_name, boost::optional const& password ) - : fixed_header_(make_fixed_header(control_packet_type::connect, 0b0000)), + : fixed_header_(static_cast(make_fixed_header(control_packet_type::connect, 0b0000))), connect_flags_(0), // protocol name length, protocol name, protocol level, connect flag, client id length, client id, keep alive remaining_length_( @@ -413,7 +413,7 @@ class connect_message { ret.reserve(size()); - ret.push_back(fixed_header_); + ret.push_back(static_cast(fixed_header_)); ret.append(remaining_length_buf_.data(), remaining_length_buf_.size()); ret.append(protocol_name_and_level_.data(), protocol_name_and_level_.size()); ret.push_back(connect_flags_); @@ -477,7 +477,7 @@ class basic_publish_message { typename packet_id_type::type packet_id, as::const_buffer const& payload ) - : fixed_header_(make_fixed_header(control_packet_type::publish, 0b0000)), + : fixed_header_(static_cast(make_fixed_header(control_packet_type::publish, 0b0000))), topic_name_(topic_name), topic_name_length_buf_ { MQTT_16BITNUM_TO_BYTE_SEQ(get_size(topic_name)) }, payload_(payload), @@ -502,14 +502,14 @@ class basic_publish_message { template basic_publish_message(Iterator b, Iterator e) { if (b >= e) throw remaining_length_error(); - fixed_header_ = *b; + fixed_header_ = static_cast(*b); auto qos = publish::get_qos(fixed_header_); ++b; if (b + 4 >= e) throw remaining_length_error(); auto len_consumed = remaining_length(b, b + 4); remaining_length_ = std::get<0>(len_consumed); - auto consumed = std::get<1>(len_consumed); + auto consumed = static_cast(std::get<1>(len_consumed)); std::copy(b, b + consumed, std::back_inserter(remaining_length_buf_)); b += consumed; @@ -538,7 +538,7 @@ class basic_publish_message { break; }; - payload_ = as::buffer(&*b, std::distance(b, e)); + payload_ = as::buffer(&*b, static_cast(std::distance(b, e))); } /** @@ -589,7 +589,7 @@ class basic_publish_message { ret.reserve(size()); - ret.push_back(fixed_header_); + ret.push_back(static_cast(fixed_header_)); ret.append(remaining_length_buf_.data(), remaining_length_buf_.size()); ret.append(topic_name_length_buf_.data(), topic_name_length_buf_.size()); @@ -678,7 +678,7 @@ class basic_publish_message { } private: - char fixed_header_; + std::uint8_t fixed_header_; as::const_buffer topic_name_; boost::container::static_vector topic_name_length_buf_; boost::container::static_vector packet_id_; @@ -710,7 +710,7 @@ class basic_subscribe_message { std::vector> const& params, typename packet_id_type::type packet_id ) - : fixed_header_(static_cast(make_fixed_header(control_packet_type::subscribe, 0b0010))), + : fixed_header_(static_cast(static_cast(make_fixed_header(control_packet_type::subscribe, 0b0010)))), remaining_length_(PacketIdBytes) { add_packet_id_to_buf::apply(packet_id_, packet_id); @@ -780,7 +780,7 @@ class basic_subscribe_message { ret.reserve(size()); - ret.push_back(fixed_header_); + ret.push_back(static_cast(fixed_header_)); ret.append(remaining_length_buf_.data(), remaining_length_buf_.size()); ret.append(packet_id_.data(), packet_id_.size()); @@ -788,7 +788,7 @@ class basic_subscribe_message { for (auto const& e : entries_) { ret.append(e.topic_name_length_buf.data(), e.topic_name_length_buf.size()); ret.append(get_pointer(e.topic_name), get_size(e.topic_name)); - ret.push_back(e.qos); + ret.push_back(static_cast(e.qos)); } @@ -812,7 +812,7 @@ class basic_suback_message { std::vector const& params, typename packet_id_type::type packet_id ) - : fixed_header_(static_cast(make_fixed_header(control_packet_type::suback, 0b0000))), + : fixed_header_(static_cast(static_cast(make_fixed_header(control_packet_type::suback, 0b0000)))), remaining_length_(params.size() + PacketIdBytes) { add_packet_id_to_buf::apply(packet_id_, packet_id); @@ -862,7 +862,7 @@ class basic_suback_message { ret.reserve(size()); - ret.push_back(fixed_header_); + ret.push_back(static_cast(fixed_header_)); ret.append(remaining_length_buf_.data(), remaining_length_buf_.size()); ret.append(packet_id_.data(), packet_id_.size()); @@ -963,7 +963,7 @@ class basic_unsubscribe_message { std::string ret; ret.reserve(size()); - ret.push_back(fixed_header_); + ret.push_back(static_cast(fixed_header_)); ret.append(remaining_length_buf_.data(), remaining_length_buf_.size()); diff --git a/include/mqtt/publish.hpp b/include/mqtt/publish.hpp index fe341c683..dba8719db 100644 --- a/include/mqtt/publish.hpp +++ b/include/mqtt/publish.hpp @@ -14,33 +14,35 @@ namespace mqtt { namespace publish { inline -constexpr bool is_dup(char v) { +constexpr bool is_dup(std::uint8_t v) { return (v & 0b00001000) != 0; } inline -constexpr std::uint8_t get_qos(char v) { - return static_cast(v & 0b00000110) >> 1; +constexpr std::uint8_t get_qos(std::uint8_t v) { + return (v & 0b00000110) >> 1; } -constexpr bool is_retain(char v) { +inline +constexpr bool is_retain(std::uint8_t v) { return (v & 0b00000001) != 0; } inline -constexpr void set_dup(char& fixed_header, bool dup) { +constexpr void set_dup(std::uint8_t& fixed_header, bool dup) { if (dup) fixed_header |= 0b00001000; - else fixed_header &= ~0b00001000; + else fixed_header &= static_cast(~0b00001000); } inline -constexpr void set_qos(char& fixed_header, std::uint8_t qos) { - fixed_header |= qos << 1; +constexpr void set_qos(std::uint8_t& fixed_header, std::uint8_t qos) { + fixed_header |= static_cast(qos << 1); } -constexpr void set_retain(char& fixed_header, bool retain) { +inline +constexpr void set_retain(std::uint8_t& fixed_header, bool retain) { if (retain) fixed_header |= 0b00000001; - else fixed_header &= ~0b00000001; + else fixed_header &= static_cast(~0b00000001); } } // namespace publish diff --git a/include/mqtt/remaining_length.hpp b/include/mqtt/remaining_length.hpp index a2a8057b0..452b9bac1 100644 --- a/include/mqtt/remaining_length.hpp +++ b/include/mqtt/remaining_length.hpp @@ -14,10 +14,10 @@ namespace mqtt { inline std::string remaining_bytes(std::size_t size) { - if (size > 0xfffffff) throw remaining_length_error(); + if (size > 0xfffffffU) throw remaining_length_error(); std::string bytes; - while (size > 127) { - bytes.push_back((size & 0b01111111) | 0b10000000); + while (size > 127U) { + bytes.push_back(static_cast((size & 0b01111111) | 0b10000000)); size >>= 7; } bytes.push_back(size & 0b01111111); diff --git a/include/mqtt/two_byte_util.hpp b/include/mqtt/two_byte_util.hpp index 00fb2eb91..08660b394 100644 --- a/include/mqtt/two_byte_util.hpp +++ b/include/mqtt/two_byte_util.hpp @@ -29,8 +29,10 @@ std::uint16_t make_uint16_t(It b, It e) { auto b1 = b++; auto b2 = b++; return - (static_cast(*b1) & 0xff) << 8 | - (static_cast(*b2) & 0xff); + static_cast( + (static_cast(*b1) & 0xff) << 8 | + (static_cast(*b2) & 0xff) + ); } } // namespace mqtt diff --git a/test/as_buffer_async_pubsub_1.cpp b/test/as_buffer_async_pubsub_1.cpp index 07e3258c3..cd650fc70 100644 --- a/test/as_buffer_async_pubsub_1.cpp +++ b/test/as_buffer_async_pubsub_1.cpp @@ -20,7 +20,7 @@ BOOST_AUTO_TEST_CASE( pub_qos0_sub_qos0 ) { packet_id_t pid_sub; packet_id_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -159,7 +159,7 @@ BOOST_AUTO_TEST_CASE( pub_qos1_sub_qos0 ) { packet_id_t pid_sub; packet_id_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -300,7 +300,7 @@ BOOST_AUTO_TEST_CASE( pub_qos2_sub_qos0 ) { packet_id_t pid_sub; packet_id_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -443,7 +443,7 @@ BOOST_AUTO_TEST_CASE( pub_qos0_sub_qos1 ) { packet_id_t pid_sub; packet_id_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -582,7 +582,7 @@ BOOST_AUTO_TEST_CASE( pub_qos1_sub_qos1 ) { packet_id_t pid_sub; packet_id_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -728,7 +728,7 @@ BOOST_AUTO_TEST_CASE( pub_qos2_sub_qos1 ) { packet_id_t pid_sub; packet_id_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect diff --git a/test/as_buffer_async_pubsub_2.cpp b/test/as_buffer_async_pubsub_2.cpp index 94c445305..4fba0bd17 100644 --- a/test/as_buffer_async_pubsub_2.cpp +++ b/test/as_buffer_async_pubsub_2.cpp @@ -20,7 +20,7 @@ BOOST_AUTO_TEST_CASE( pub_qos0_sub_qos2 ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -159,7 +159,7 @@ BOOST_AUTO_TEST_CASE( pub_qos1_sub_qos2 ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -306,7 +306,7 @@ BOOST_AUTO_TEST_CASE( pub_qos2_sub_qos2 ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -454,7 +454,7 @@ BOOST_AUTO_TEST_CASE( publish_function ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -587,7 +587,7 @@ BOOST_AUTO_TEST_CASE( publish_dup_function ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect diff --git a/test/as_buffer_pubsub.cpp b/test/as_buffer_pubsub.cpp index 7e877defa..300fac7d4 100644 --- a/test/as_buffer_pubsub.cpp +++ b/test/as_buffer_pubsub.cpp @@ -17,7 +17,7 @@ BOOST_AUTO_TEST_CASE( pub_qos0_sub_qos0 ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -144,7 +144,7 @@ BOOST_AUTO_TEST_CASE( pub_qos1_sub_qos0 ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -287,7 +287,7 @@ BOOST_AUTO_TEST_CASE( pub_qos2_sub_qos0 ) { bool pub_seq_finished = false; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -422,7 +422,7 @@ BOOST_AUTO_TEST_CASE( pub_qos0_sub_qos1 ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -550,7 +550,7 @@ BOOST_AUTO_TEST_CASE( pub_qos1_sub_qos1 ) { bool pub_seq_finished = false; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -690,7 +690,7 @@ BOOST_AUTO_TEST_CASE( pub_qos2_sub_qos1 ) { bool pub_seq_finished = false; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -830,7 +830,7 @@ BOOST_AUTO_TEST_CASE( pub_qos0_sub_qos2 ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -958,7 +958,7 @@ BOOST_AUTO_TEST_CASE( pub_qos1_sub_qos2 ) { bool pub_seq_finished = false; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -1098,7 +1098,7 @@ BOOST_AUTO_TEST_CASE( pub_qos2_sub_qos2 ) { bool pub_seq_finished = false; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -1238,7 +1238,7 @@ BOOST_AUTO_TEST_CASE( publish_function ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -1362,7 +1362,7 @@ BOOST_AUTO_TEST_CASE( publish_dup_function ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect diff --git a/test/as_buffer_sub.cpp b/test/as_buffer_sub.cpp index 9c666cc6e..73a934149 100644 --- a/test/as_buffer_sub.cpp +++ b/test/as_buffer_sub.cpp @@ -14,7 +14,7 @@ BOOST_AUTO_TEST_CASE( pub_qos0_sub_string_single ) { using packet_id_t = typename std::remove_reference_t::packet_id_t; c->set_clean_session(true); - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -90,7 +90,7 @@ BOOST_AUTO_TEST_CASE( pub_qos0_sub_string_multi_arg ) { using packet_id_t = typename std::remove_reference_t::packet_id_t; c->set_clean_session(true); - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -170,7 +170,7 @@ BOOST_AUTO_TEST_CASE( pub_qos0_sub_string_multi_vec ) { using packet_id_t = typename std::remove_reference_t::packet_id_t; c->set_clean_session(true); - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -256,7 +256,7 @@ BOOST_AUTO_TEST_CASE( pub_qos0_sub_string_single_async ) { using packet_id_t = typename std::remove_reference_t::packet_id_t; c->set_clean_session(true); - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -337,7 +337,7 @@ BOOST_AUTO_TEST_CASE( pub_qos0_sub_string_multi_arg_async ) { using packet_id_t = typename std::remove_reference_t::packet_id_t; c->set_clean_session(true); - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -423,7 +423,7 @@ BOOST_AUTO_TEST_CASE( pub_qos0_sub_string_multi_vec_async ) { using packet_id_t = typename std::remove_reference_t::packet_id_t; c->set_clean_session(true); - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect diff --git a/test/async_pubsub_1.cpp b/test/async_pubsub_1.cpp index 24b92f2fc..69b712c73 100644 --- a/test/async_pubsub_1.cpp +++ b/test/async_pubsub_1.cpp @@ -20,7 +20,7 @@ BOOST_AUTO_TEST_CASE( pub_qos0_sub_qos0 ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -143,7 +143,7 @@ BOOST_AUTO_TEST_CASE( pub_qos1_sub_qos0 ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -274,7 +274,7 @@ BOOST_AUTO_TEST_CASE( pub_qos2_sub_qos0 ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -402,7 +402,7 @@ BOOST_AUTO_TEST_CASE( pub_qos0_sub_qos1 ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -525,7 +525,7 @@ BOOST_AUTO_TEST_CASE( pub_qos1_sub_qos1 ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -656,7 +656,7 @@ BOOST_AUTO_TEST_CASE( pub_qos2_sub_qos1 ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect diff --git a/test/async_pubsub_2.cpp b/test/async_pubsub_2.cpp index d7f62b282..15a3af367 100644 --- a/test/async_pubsub_2.cpp +++ b/test/async_pubsub_2.cpp @@ -20,7 +20,7 @@ BOOST_AUTO_TEST_CASE( pub_qos0_sub_qos2 ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -143,7 +143,7 @@ BOOST_AUTO_TEST_CASE( pub_qos1_sub_qos2 ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -275,7 +275,7 @@ BOOST_AUTO_TEST_CASE( pub_qos2_sub_qos2 ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -408,7 +408,7 @@ BOOST_AUTO_TEST_CASE( publish_function ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -525,7 +525,7 @@ BOOST_AUTO_TEST_CASE( publish_dup_function ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect diff --git a/test/connect.cpp b/test/connect.cpp index f9d8fa5af..e22da244e 100644 --- a/test/connect.cpp +++ b/test/connect.cpp @@ -15,7 +15,7 @@ BOOST_AUTO_TEST_CASE( connect ) { c->set_clean_session(true); BOOST_TEST(c->connected() == false); - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -73,7 +73,7 @@ BOOST_AUTO_TEST_CASE( connect_no_strand ) { c->set_client_id("cid1"); c->set_clean_session(true); - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -127,7 +127,7 @@ BOOST_AUTO_TEST_CASE( keep_alive ) { c->set_client_id("cid1"); c->set_clean_session(true); - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -190,7 +190,7 @@ BOOST_AUTO_TEST_CASE( keep_alive_and_send_control_packet ) { c->set_client_id("cid1"); c->set_clean_session(true); - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -275,7 +275,7 @@ BOOST_AUTO_TEST_CASE( connect_again ) { c->set_clean_session(true); bool first = true; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -346,7 +346,7 @@ BOOST_AUTO_TEST_CASE( nocid ) { auto test = [](boost::asio::io_service& ios, auto& c, auto& s) { c->set_clean_session(true); - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -398,7 +398,7 @@ BOOST_AUTO_TEST_CASE( nocid ) { BOOST_AUTO_TEST_CASE( nocid_noclean ) { auto test = [](boost::asio::io_service& ios, auto& c, auto& s) { - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -450,7 +450,7 @@ BOOST_AUTO_TEST_CASE( noclean ) { auto test = [](boost::asio::io_service& ios, auto& c, auto& s) { c->set_client_id("cid1"); - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -560,7 +560,7 @@ BOOST_AUTO_TEST_CASE( disconnect_timeout ) { c->set_client_id("cid1"); c->set_clean_session(true); - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -615,7 +615,7 @@ BOOST_AUTO_TEST_CASE( disconnect_not_timeout ) { c->set_client_id("cid1"); c->set_clean_session(true); - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -670,7 +670,7 @@ BOOST_AUTO_TEST_CASE( async_disconnect_timeout ) { c->set_client_id("cid1"); c->set_clean_session(true); - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -725,7 +725,7 @@ BOOST_AUTO_TEST_CASE( async_disconnect_not_timeout ) { c->set_client_id("cid1"); c->set_clean_session(true); - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect diff --git a/test/length_check.cpp b/test/length_check.cpp index 428bcb48e..209c28d75 100644 --- a/test/length_check.cpp +++ b/test/length_check.cpp @@ -14,7 +14,7 @@ BOOST_AUTO_TEST_CASE( pub_qos0_sub_qos0 ) { using packet_id_t = typename std::remove_reference_t::packet_id_t; c->set_clean_session(true); - int order = 0; + std::size_t order = 0; int lc_order = 0; std::vector const expected = { diff --git a/test/manual_publish.cpp b/test/manual_publish.cpp index c3ea4db12..c431e55f0 100644 --- a/test/manual_publish.cpp +++ b/test/manual_publish.cpp @@ -14,7 +14,7 @@ BOOST_AUTO_TEST_CASE( pub_qos0_sub_qos0 ) { using packet_id_t = typename std::remove_reference_t::packet_id_t; c->set_clean_session(true); - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect diff --git a/test/multi_sub.cpp b/test/multi_sub.cpp index 0bb97f6a5..1cc7fc6f2 100644 --- a/test/multi_sub.cpp +++ b/test/multi_sub.cpp @@ -17,7 +17,7 @@ BOOST_AUTO_TEST_CASE( multi_channel ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -168,7 +168,7 @@ BOOST_AUTO_TEST_CASE( multi_client_qos0 ) { if (++close_count == 2) s.close(); }; - int order1 = 0; + std::size_t order1 = 0; std::vector const expected1 = { // connect @@ -279,7 +279,7 @@ BOOST_AUTO_TEST_CASE( multi_client_qos0 ) { std::uint16_t pid_sub2; std::uint16_t pid_unsub2; - int order2 = 0; + std::size_t order2 = 0; std::vector const expected2 = { // connect @@ -409,9 +409,9 @@ BOOST_AUTO_TEST_CASE( multi_client_qos1 ) { c1->set_client_id("cid1"); c2->set_client_id("cid2"); c3->set_client_id("cid3"); - int order1 = 0; - int order2 = 0; - int order3 = 0; + std::size_t order1 = 0; + std::size_t order2 = 0; + std::size_t order3 = 0; using packet_id_t = typename std::remove_reference_t::packet_id_t; diff --git a/test/offline.cpp b/test/offline.cpp index 37922ab38..cb46e4d78 100644 --- a/test/offline.cpp +++ b/test/offline.cpp @@ -17,7 +17,7 @@ BOOST_AUTO_TEST_CASE( publish_qos1 ) { std::uint16_t pid_pub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -116,7 +116,7 @@ BOOST_AUTO_TEST_CASE( publish_qos2 ) { std::uint16_t pid_pub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -225,7 +225,7 @@ BOOST_AUTO_TEST_CASE( multi_publish_qos1 ) { std::uint16_t pid_pub1; std::uint16_t pid_pub2; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -338,7 +338,7 @@ BOOST_AUTO_TEST_CASE( async_publish_qos1 ) { std::uint16_t pid_pub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect diff --git a/test/pubsub.cpp b/test/pubsub.cpp index 0b9ed6b76..3d2f60b6b 100644 --- a/test/pubsub.cpp +++ b/test/pubsub.cpp @@ -17,7 +17,7 @@ BOOST_AUTO_TEST_CASE( pub_qos0_sub_qos0 ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -141,7 +141,7 @@ BOOST_AUTO_TEST_CASE( pub_qos1_sub_qos0 ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -275,7 +275,7 @@ BOOST_AUTO_TEST_CASE( pub_qos2_sub_qos0 ) { bool pub_seq_finished = false; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -404,7 +404,7 @@ BOOST_AUTO_TEST_CASE( pub_qos0_sub_qos1 ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -529,7 +529,7 @@ BOOST_AUTO_TEST_CASE( pub_qos1_sub_qos1 ) { bool pub_seq_finished = false; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -663,7 +663,7 @@ BOOST_AUTO_TEST_CASE( pub_qos2_sub_qos1 ) { bool pub_seq_finished = false; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -797,7 +797,7 @@ BOOST_AUTO_TEST_CASE( pub_qos0_sub_qos2 ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -922,7 +922,7 @@ BOOST_AUTO_TEST_CASE( pub_qos1_sub_qos2 ) { bool pub_seq_finished = false; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -1056,7 +1056,7 @@ BOOST_AUTO_TEST_CASE( pub_qos2_sub_qos2 ) { bool pub_seq_finished = false; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -1190,7 +1190,7 @@ BOOST_AUTO_TEST_CASE( publish_function ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -1307,7 +1307,7 @@ BOOST_AUTO_TEST_CASE( publish_dup_function ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect diff --git a/test/pubsub_no_strand.cpp b/test/pubsub_no_strand.cpp index 1178cf3f6..900865474 100644 --- a/test/pubsub_no_strand.cpp +++ b/test/pubsub_no_strand.cpp @@ -24,7 +24,7 @@ BOOST_AUTO_TEST_CASE( pub_qos0_sub_qos0 ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -145,7 +145,7 @@ BOOST_AUTO_TEST_CASE( pub_qos1_sub_qos0 ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -267,7 +267,7 @@ BOOST_AUTO_TEST_CASE( pub_qos2_sub_qos0 ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -391,7 +391,7 @@ BOOST_AUTO_TEST_CASE( pub_qos0_sub_qos1 ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -510,7 +510,7 @@ BOOST_AUTO_TEST_CASE( pub_qos1_sub_qos1 ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -642,7 +642,7 @@ BOOST_AUTO_TEST_CASE( pub_qos2_sub_qos1 ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -776,7 +776,7 @@ BOOST_AUTO_TEST_CASE( pub_qos0_sub_qos2 ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -895,7 +895,7 @@ BOOST_AUTO_TEST_CASE( pub_qos1_sub_qos2 ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -1027,7 +1027,7 @@ BOOST_AUTO_TEST_CASE( pub_qos2_sub_qos2 ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -1161,7 +1161,7 @@ BOOST_AUTO_TEST_CASE( publish_function ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect diff --git a/test/remaining_length.cpp b/test/remaining_length.cpp index bdcbe1df6..719edb5d6 100644 --- a/test/remaining_length.cpp +++ b/test/remaining_length.cpp @@ -22,7 +22,7 @@ BOOST_AUTO_TEST_CASE( pub_sub_over_127 ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -144,7 +144,7 @@ BOOST_AUTO_TEST_CASE( pub_sub_over_16384 ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -268,7 +268,7 @@ BOOST_AUTO_TEST_CASE( pub_sub_over_2097152 ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect diff --git a/test/resend.cpp b/test/resend.cpp index 7517f5526..e35620eda 100644 --- a/test/resend.cpp +++ b/test/resend.cpp @@ -17,7 +17,7 @@ BOOST_AUTO_TEST_CASE( publish_qos1 ) { std::uint16_t pid_pub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -127,7 +127,7 @@ BOOST_AUTO_TEST_CASE( publish_qos2 ) { std::uint16_t pid_pub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -246,7 +246,7 @@ BOOST_AUTO_TEST_CASE( pubrel_qos2 ) { std::uint16_t pid_pub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -372,7 +372,7 @@ BOOST_AUTO_TEST_CASE( publish_pubrel_qos2 ) { std::uint16_t pid_pub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -521,7 +521,7 @@ BOOST_AUTO_TEST_CASE( multi_publish_qos1 ) { std::uint16_t pid_pub1; std::uint16_t pid_pub2; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect diff --git a/test/resend_serialize.cpp b/test/resend_serialize.cpp index 12a2a12a5..f3ae3fda5 100644 --- a/test/resend_serialize.cpp +++ b/test/resend_serialize.cpp @@ -129,7 +129,7 @@ BOOST_AUTO_TEST_CASE( publish_qos1 ) { std::uint16_t pid_pub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -291,7 +291,7 @@ BOOST_AUTO_TEST_CASE( publish_qos2 ) { std::uint16_t pid_pub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -461,7 +461,7 @@ BOOST_AUTO_TEST_CASE( pubrel_qos2 ) { std::uint16_t pid_pub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -639,7 +639,7 @@ BOOST_AUTO_TEST_CASE( multi_publish_qos1 ) { std::uint16_t pid_pub1; std::uint16_t pid_pub2; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect diff --git a/test/resend_serialize_ptr_size.cpp b/test/resend_serialize_ptr_size.cpp index b230b65fb..440130eb7 100644 --- a/test/resend_serialize_ptr_size.cpp +++ b/test/resend_serialize_ptr_size.cpp @@ -56,7 +56,7 @@ BOOST_AUTO_TEST_CASE( publish_qos1 ) { std::uint16_t pid_pub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -204,7 +204,7 @@ BOOST_AUTO_TEST_CASE( publish_qos2 ) { std::uint16_t pid_pub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -360,7 +360,7 @@ BOOST_AUTO_TEST_CASE( pubrel_qos2 ) { std::uint16_t pid_pub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -524,7 +524,7 @@ BOOST_AUTO_TEST_CASE( multi_publish_qos1 ) { std::uint16_t pid_pub1; std::uint16_t pid_pub2; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect diff --git a/test/retain.cpp b/test/retain.cpp index dc5f75259..a91ea2f01 100644 --- a/test/retain.cpp +++ b/test/retain.cpp @@ -17,7 +17,7 @@ BOOST_AUTO_TEST_CASE( simple ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -136,7 +136,7 @@ BOOST_AUTO_TEST_CASE( overwrite ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -259,7 +259,7 @@ BOOST_AUTO_TEST_CASE( retain_and_publish ) { std::uint16_t pid_sub; std::uint16_t pid_unsub; - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect diff --git a/test/sub.cpp b/test/sub.cpp index b6ecc3f58..fa93b938b 100644 --- a/test/sub.cpp +++ b/test/sub.cpp @@ -14,7 +14,7 @@ BOOST_AUTO_TEST_CASE( pub_qos0_sub_string_single ) { using packet_id_t = typename std::remove_reference_t::packet_id_t; c->set_clean_session(true); - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -88,7 +88,7 @@ BOOST_AUTO_TEST_CASE( pub_qos0_sub_string_multi_arg ) { using packet_id_t = typename std::remove_reference_t::packet_id_t; c->set_clean_session(true); - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -162,7 +162,7 @@ BOOST_AUTO_TEST_CASE( pub_qos0_sub_string_multi_vec ) { using packet_id_t = typename std::remove_reference_t::packet_id_t; c->set_clean_session(true); - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -244,7 +244,7 @@ BOOST_AUTO_TEST_CASE( pub_qos0_sub_string_single_async ) { using packet_id_t = typename std::remove_reference_t::packet_id_t; c->set_clean_session(true); - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -318,7 +318,7 @@ BOOST_AUTO_TEST_CASE( pub_qos0_sub_string_multi_arg_async ) { using packet_id_t = typename std::remove_reference_t::packet_id_t; c->set_clean_session(true); - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect @@ -400,7 +400,7 @@ BOOST_AUTO_TEST_CASE( pub_qos0_sub_string_multi_vec_async ) { using packet_id_t = typename std::remove_reference_t::packet_id_t; c->set_clean_session(true); - int order = 0; + std::size_t order = 0; std::vector const expected = { // connect diff --git a/test/will.cpp b/test/will.cpp index ff15aad4f..8da0f154a 100644 --- a/test/will.cpp +++ b/test/will.cpp @@ -34,7 +34,7 @@ BOOST_AUTO_TEST_CASE( will_qos0 ) { using packet_id_t = typename std::remove_reference_t::packet_id_t; - int order1 = 0; + std::size_t order1 = 0; std::vector const expected1 = { // connect @@ -79,7 +79,7 @@ BOOST_AUTO_TEST_CASE( will_qos0 ) { std::uint16_t pid_sub2; std::uint16_t pid_unsub2; - int order2 = 0; + std::size_t order2 = 0; std::vector const expected2 = { // connect @@ -193,7 +193,7 @@ BOOST_AUTO_TEST_CASE( will_qos1 ) { using packet_id_t = typename std::remove_reference_t::packet_id_t; - int order1 = 0; + std::size_t order1 = 0; std::vector const expected1 = { // connect @@ -238,7 +238,7 @@ BOOST_AUTO_TEST_CASE( will_qos1 ) { std::uint16_t pid_sub2; std::uint16_t pid_unsub2; - int order2 = 0; + std::size_t order2 = 0; std::vector const expected2 = { // connect @@ -352,7 +352,7 @@ BOOST_AUTO_TEST_CASE( will_qos2 ) { using packet_id_t = typename std::remove_reference_t::packet_id_t; - int order1 = 0; + std::size_t order1 = 0; std::vector const expected1 = { // connect @@ -397,7 +397,7 @@ BOOST_AUTO_TEST_CASE( will_qos2 ) { std::uint16_t pid_sub2; std::uint16_t pid_unsub2; - int order2 = 0; + std::size_t order2 = 0; std::vector const expected2 = { // connect @@ -518,7 +518,7 @@ BOOST_AUTO_TEST_CASE( will_retain ) { using packet_id_t = typename std::remove_reference_t::packet_id_t; - int order1 = 0; + std::size_t order1 = 0; std::vector const expected1 = { // connect @@ -563,7 +563,7 @@ BOOST_AUTO_TEST_CASE( will_retain ) { std::uint16_t pid_sub2; std::uint16_t pid_unsub2; - int order2 = 0; + std::size_t order2 = 0; std::vector const expected2 = { // connect