Remove connection error codes

Summary: related to T13767

Reviewers: ivica

Reviewed By: ivica

Subscribers: miljen, iljazovic

Differential Revision: https://repo.mireo.local/D28117
This commit is contained in:
Korina Šimičević
2024-02-23 13:29:56 +01:00
parent 3d80f47010
commit 2f055e8894
2 changed files with 0 additions and 263 deletions

View File

@@ -50,59 +50,6 @@ BOOST_FIXTURE_TEST_CASE(client_ec_to_stream, client_error_codes) {
}
}
struct connection_error_codes {
const connection::connection_ec_category& cat = connection::get_error_code_category();
const std::vector<connection::error> ecs = {
connection::error::success,
connection::error::tls_handshake_error,
connection::error::websocket_handshake_error,
connection::error::unspecified_error,
connection::error::malformed_packet,
connection::error::protocol_error,
connection::error::implementation_specific_error,
connection::error::unsupported_protocol_version,
connection::error::client_identifier_not_valid,
connection::error::bad_username_or_password,
connection::error::not_authorized,
connection::error::server_unavailable,
connection::error::server_busy,
connection::error::banned,
connection::error::bad_authentication_method,
connection::error::topic_name_invalid,
connection::error::packet_too_large,
connection::error::quota_exceeded,
connection::error::payload_format_invalid,
connection::error::retain_not_supported,
connection::error::qos_not_supported,
connection::error::use_another_server,
connection::error::server_moved,
connection::error::connection_rate_exceeded
};
};
BOOST_FIXTURE_TEST_CASE(connection_ec_to_string, connection_error_codes) {
// Ensure that all branches of the switch/case are covered
BOOST_TEST(cat.name());
constexpr auto default_output = "Unknown connection error";
for (auto ec : ecs)
BOOST_TEST(cat.message(static_cast<int>(ec)) != default_output);
// default branch
BOOST_TEST(cat.message(3) == default_output);
}
BOOST_FIXTURE_TEST_CASE(connection_ec_to_stream, connection_error_codes) {
for (auto ec : ecs) {
std::ostringstream stream;
stream << ec;
std::string expected = std::string(cat.name()) + ":" +
std::to_string(static_cast<int>(ec));
BOOST_TEST(stream.str() == expected);
}
}
using namespace reason_codes;
struct client_reason_codes {
const std::vector<reason_code> rcs = {