From 1098f08e559ec30679ca4a7cee519d9a09118c7b Mon Sep 17 00:00:00 2001 From: Kory Draughn Date: Tue, 9 Apr 2024 15:37:52 -0400 Subject: [PATCH] [7636] Change naming scheme used by feature test macros. --- lib/core/include/irods/library_features.h | 49 +++++++++++++++++-- server/api/src/rs_get_library_features.cpp | 16 +++++- .../src/test_rc_get_library_features.cpp | 16 +++++- 3 files changed, 74 insertions(+), 7 deletions(-) diff --git a/lib/core/include/irods/library_features.h b/lib/core/include/irods/library_features.h index 5a9af8c2cb..e9d7a47b40 100644 --- a/lib/core/include/irods/library_features.h +++ b/lib/core/include/irods/library_features.h @@ -21,42 +21,85 @@ /// Defined if the development library supports the C++ ticket administration library. /// +/// \sa Prefer IRODS_LIBRARY_FEATURE_TICKET_ADMINISTRATION +/// /// \since 4.3.1 #define IRODS_HAS_LIBRARY_TICKET_ADMINISTRATION 202209L +/// An alias for #IRODS_HAS_LIBRARY_TICKET_ADMINISTRATION. +/// +/// \since 4.3.2 +#define IRODS_LIBRARY_FEATURE_TICKET_ADMINISTRATION IRODS_HAS_LIBRARY_TICKET_ADMINISTRATION + /// Defined if the development library supports the C++ zone administration library. /// +/// \sa Prefer IRODS_LIBRARY_FEATURE_ZONE_ADMINISTRATION +/// /// \since 4.3.1 #define IRODS_HAS_LIBRARY_ZONE_ADMINISTRATION 202210L +/// An alias for #IRODS_HAS_LIBRARY_ZONE_ADMINISTRATION. +/// +/// \since 4.3.2 +#define IRODS_LIBRARY_FEATURE_ZONE_ADMINISTRATION IRODS_HAS_LIBRARY_ZONE_ADMINISTRATION + /// Defined if the development library supports #rc_switch_user. /// +/// \sa Prefer IRODS_LIBRARY_FEATURE_SWITCH_USER +/// /// \since 4.3.1 #define IRODS_HAS_API_ENDPOINT_SWITCH_USER 202211L +/// An alias for #IRODS_HAS_API_ENDPOINT_SWITCH_USER. +/// +/// \since 4.3.2 +#define IRODS_LIBRARY_FEATURE_SWITCH_USER IRODS_HAS_API_ENDPOINT_SWITCH_USER + /// Defined if the development library supports the C++ system_error library. /// +/// \sa Prefer IRODS_LIBRARY_FEATURE_SYSTEM_ERROR +/// /// \since 4.3.1 #define IRODS_HAS_LIBRARY_SYSTEM_ERROR 202301L +/// An alias for #IRODS_HAS_LIBRARY_SYSTEM_ERROR. +/// +/// \since 4.3.2 +#define IRODS_LIBRARY_FEATURE_SYSTEM_ERROR IRODS_HAS_LIBRARY_SYSTEM_ERROR + /// Defined if the C++ client connection libraries support proxy users. /// +/// \sa Prefer IRODS_LIBRARY_FEATURE_CLIENT_CONNECTION_LIBRARIES_SUPPORT_PROXY_USERS +/// /// \since 4.3.1 #define IRODS_HAS_FEATURE_PROXY_USER_SUPPORT_FOR_CLIENT_CONNECTION_LIBRARIES 202306L +/// An alias for #IRODS_HAS_FEATURE_PROXY_USER_SUPPORT_FOR_CLIENT_CONNECTION_LIBRARIES. +/// +/// \since 4.3.2 +#define IRODS_LIBRARY_FEATURE_CLIENT_CONNECTION_LIBRARIES_SUPPORT_PROXY_USERS \ + IRODS_HAS_FEATURE_PROXY_USER_SUPPORT_FOR_CLIENT_CONNECTION_LIBRARIES + /// Defined if the development library supports #rc_check_auth_credentials. /// +/// \sa Prefer IRODS_LIBRARY_FEATURE_CHECK_AUTH_CREDENTIALS +/// /// \since 4.3.1 -#define IRODS_HAS_API_ENDPOINT_CHECK_AUTH_CREDENTIALS 202307L +#define IRODS_HAS_API_ENDPOINT_CHECK_AUTH_CREDENTIALS 202307L + +/// An alias for #IRODS_HAS_API_ENDPOINT_CHECK_AUTH_CREDENTIALS. +/// +/// \since 4.3.2 +#define IRODS_LIBRARY_FEATURE_CHECK_AUTH_CREDENTIALS IRODS_HAS_API_ENDPOINT_CHECK_AUTH_CREDENTIALS /// Defined if the development library supports #rc_replica_truncate. /// /// \since 4.3.2 -#define IRODS_HAS_API_ENDPOINT_REPLICA_TRUNCATE 202403L +#define IRODS_LIBRARY_FEATURE_REPLICA_TRUNCATE 202403L /// Defined if the development library supports #rc_genquery2. /// /// \since 4.3.2 -#define IRODS_HAS_API_ENDPOINT_GENQUERY2 202403L +#define IRODS_LIBRARY_FEATURE_GENQUERY2 202404L #endif // IRODS_LIBRARY_FEATURES_H diff --git a/server/api/src/rs_get_library_features.cpp b/server/api/src/rs_get_library_features.cpp index d9506be457..c34b4ca552 100644 --- a/server/api/src/rs_get_library_features.cpp +++ b/server/api/src/rs_get_library_features.cpp @@ -22,13 +22,25 @@ auto rs_get_library_features(RsComm* _comm, char** _features) -> int // clang-format off *_features = strdup(nlohmann::json{ IRODS_FEATURE(IRODS_HAS_LIBRARY_TICKET_ADMINISTRATION) + IRODS_FEATURE(IRODS_LIBRARY_FEATURE_TICKET_ADMINISTRATION) + IRODS_FEATURE(IRODS_HAS_LIBRARY_ZONE_ADMINISTRATION) + IRODS_FEATURE(IRODS_LIBRARY_FEATURE_ZONE_ADMINISTRATION) + IRODS_FEATURE(IRODS_HAS_API_ENDPOINT_SWITCH_USER) + IRODS_FEATURE(IRODS_LIBRARY_FEATURE_SWITCH_USER) + IRODS_FEATURE(IRODS_HAS_LIBRARY_SYSTEM_ERROR) + IRODS_FEATURE(IRODS_LIBRARY_FEATURE_SYSTEM_ERROR) + IRODS_FEATURE(IRODS_HAS_FEATURE_PROXY_USER_SUPPORT_FOR_CLIENT_CONNECTION_LIBRARIES) + IRODS_FEATURE(IRODS_LIBRARY_FEATURE_CLIENT_CONNECTION_LIBRARIES_SUPPORT_PROXY_USERS) + IRODS_FEATURE(IRODS_HAS_API_ENDPOINT_CHECK_AUTH_CREDENTIALS) - IRODS_FEATURE(IRODS_HAS_API_ENDPOINT_REPLICA_TRUNCATE) - IRODS_FEATURE(IRODS_HAS_API_ENDPOINT_GENQUERY2) + IRODS_FEATURE(IRODS_LIBRARY_FEATURE_CHECK_AUTH_CREDENTIALS) + + IRODS_FEATURE(IRODS_LIBRARY_FEATURE_REPLICA_TRUNCATE) + IRODS_FEATURE(IRODS_LIBRARY_FEATURE_GENQUERY2) }.dump().c_str()); // clang-format on diff --git a/unit_tests/src/test_rc_get_library_features.cpp b/unit_tests/src/test_rc_get_library_features.cpp index 205b1145dc..ab94c23454 100644 --- a/unit_tests/src/test_rc_get_library_features.cpp +++ b/unit_tests/src/test_rc_get_library_features.cpp @@ -28,13 +28,25 @@ TEST_CASE("rc_get_library_features") // clang-format off CHECK(202209 == features.at(IRODS_TO_STRING(IRODS_HAS_LIBRARY_TICKET_ADMINISTRATION)).get()); + CHECK(202209 == features.at(IRODS_TO_STRING(IRODS_LIBRARY_FEATURE_TICKET_ADMINISTRATION)).get()); + CHECK(202210 == features.at(IRODS_TO_STRING(IRODS_HAS_LIBRARY_ZONE_ADMINISTRATION)).get()); + CHECK(202210 == features.at(IRODS_TO_STRING(IRODS_LIBRARY_FEATURE_ZONE_ADMINISTRATION)).get()); + CHECK(202211 == features.at(IRODS_TO_STRING(IRODS_HAS_API_ENDPOINT_SWITCH_USER)).get()); + CHECK(202211 == features.at(IRODS_TO_STRING(IRODS_LIBRARY_FEATURE_SWITCH_USER)).get()); + CHECK(202301 == features.at(IRODS_TO_STRING(IRODS_HAS_LIBRARY_SYSTEM_ERROR)).get()); + CHECK(202301 == features.at(IRODS_TO_STRING(IRODS_LIBRARY_FEATURE_SYSTEM_ERROR)).get()); + CHECK(202306 == features.at(IRODS_TO_STRING(IRODS_HAS_FEATURE_PROXY_USER_SUPPORT_FOR_CLIENT_CONNECTION_LIBRARIES)).get()); + CHECK(202306 == features.at(IRODS_TO_STRING(IRODS_LIBRARY_FEATURE_CLIENT_CONNECTION_LIBRARIES_SUPPORT_PROXY_USERS)).get()); + CHECK(202307 == features.at(IRODS_TO_STRING(IRODS_HAS_API_ENDPOINT_CHECK_AUTH_CREDENTIALS)).get()); - CHECK(202403 == features.at(IRODS_TO_STRING(IRODS_HAS_API_ENDPOINT_REPLICA_TRUNCATE)).get()); - CHECK(202403 == features.at(IRODS_TO_STRING(IRODS_HAS_API_ENDPOINT_GENQUERY2)).get()); + CHECK(202307 == features.at(IRODS_TO_STRING(IRODS_LIBRARY_FEATURE_CHECK_AUTH_CREDENTIALS)).get()); + + CHECK(202403 == features.at(IRODS_TO_STRING(IRODS_LIBRARY_FEATURE_REPLICA_TRUNCATE)).get()); + CHECK(202404 == features.at(IRODS_TO_STRING(IRODS_LIBRARY_FEATURE_GENQUERY2)).get()); // clang-format on }