Skip to content

Commit

Permalink
squash. code review - check errno
Browse files Browse the repository at this point in the history
  • Loading branch information
korydraughn committed Jul 25, 2024
1 parent 47baa36 commit 5b7b7ca
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions unit_tests/src/test_client_connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#include "irods/user_administration.hpp"
#include "irods/system_error.hpp"

#include <errno.h> // For ECONNREFUSED.

#include <algorithm>
#include <array>
#include <string_view>
Expand Down Expand Up @@ -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"));
}
}
Expand Down

0 comments on commit 5b7b7ca

Please sign in to comment.