diff --git a/unit_tests/src/test_client_connection.cpp b/unit_tests/src/test_client_connection.cpp index a58a39c5c7..ad47e5e4de 100644 --- a/unit_tests/src/test_client_connection.cpp +++ b/unit_tests/src/test_client_connection.cpp @@ -15,6 +15,8 @@ #include "irods/user_administration.hpp" #include "irods/system_error.hpp" +#include // For ECONNREFUSED. + #include #include #include @@ -332,9 +334,9 @@ TEST_CASE("#7155: report underlying error info from server on failed connection" ix::client_connection{env.rodsHost, 8080, {env.rodsUserName, env.rodsZone}}; } catch (const irods::exception& e) { - // Extract the iRODS error code, ignoring the embedded errno value. - const auto errc = ix::make_error_code(e.code()); - CHECK(ix::get_irods_error_code(errc) == USER_SOCK_CONNECT_ERR); + const auto ec = ix::make_error_code(e.code()); + CHECK(ix::get_irods_error_code(ec) == USER_SOCK_CONNECT_ERR); + CHECK(ix::get_errno(ec) == ECONNREFUSED); CHECK_THAT(e.client_display_what(), Catch::Matchers::Contains("_rcConnect: connectToRhost failed")); } }