Skip to content

Commit

Permalink
[7636] Change naming scheme used by feature test macros.
Browse files Browse the repository at this point in the history
  • Loading branch information
korydraughn committed Apr 9, 2024
1 parent 7466e23 commit fe39e00
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 10 deletions.
23 changes: 15 additions & 8 deletions lib/core/include/irods/library_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,41 +22,48 @@
/// Defined if the development library supports the C++ ticket administration library.
///
/// \since 4.3.1
#define IRODS_HAS_LIBRARY_TICKET_ADMINISTRATION 202209L
#define IRODS_HAS_LIBRARY_TICKET_ADMINISTRATION 202209L
#define IRODS_LIBRARY_FEATURE_LIBRARY_TICKET_ADMINISTRATION 202209L

/// Defined if the development library supports the C++ zone administration library.
///
/// \since 4.3.1
#define IRODS_HAS_LIBRARY_ZONE_ADMINISTRATION 202210L
#define IRODS_HAS_LIBRARY_ZONE_ADMINISTRATION 202210L
#define IRODS_LIBRARY_FEATURE_LIBRARY_ZONE_ADMINISTRATION 202210L

/// Defined if the development library supports #rc_switch_user.
///
/// \since 4.3.1
#define IRODS_HAS_API_ENDPOINT_SWITCH_USER 202211L
#define IRODS_HAS_API_ENDPOINT_SWITCH_USER 202211L
#define IRODS_LIBRARY_FEATURE_API_ENDPOINT_SWITCH_USER 202211L

/// Defined if the development library supports the C++ system_error library.
///
/// \since 4.3.1
#define IRODS_HAS_LIBRARY_SYSTEM_ERROR 202301L
#define IRODS_HAS_LIBRARY_SYSTEM_ERROR 202301L
#define IRODS_LIBRARY_FEATURE_LIBRARY_SYSTEM_ERROR 202301L

/// Defined if the C++ client connection libraries support proxy users.
///
/// \since 4.3.1
#define IRODS_HAS_FEATURE_PROXY_USER_SUPPORT_FOR_CLIENT_CONNECTION_LIBRARIES 202306L
#define IRODS_HAS_FEATURE_PROXY_USER_SUPPORT_FOR_CLIENT_CONNECTION_LIBRARIES 202306L
#define IRODS_LIBRARY_FEATURE_PROXY_USER_SUPPORT_FOR_CLIENT_CONNECTION_LIBRARIES 202306L

/// Defined if the development library supports #rc_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
#define IRODS_LIBRARY_FEATURE_API_ENDPOINT_CHECK_AUTH_CREDENTIALS 202307L

/// Defined if the development library supports #rc_replica_truncate.
///
/// \since 4.3.2
#define IRODS_HAS_API_ENDPOINT_REPLICA_TRUNCATE 202403L
#define IRODS_HAS_API_ENDPOINT_REPLICA_TRUNCATE 202403L
#define IRODS_LIBRARY_FEATURE_API_ENDPOINT_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_API_ENDPOINT_GENQUERY2 202404L

#endif // IRODS_LIBRARY_FEATURES_H
16 changes: 15 additions & 1 deletion server/api/src/rs_get_library_features.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,27 @@ 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_LIBRARY_TICKET_ADMINISTRATION)

IRODS_FEATURE(IRODS_HAS_LIBRARY_ZONE_ADMINISTRATION)
IRODS_FEATURE(IRODS_LIBRARY_FEATURE_LIBRARY_ZONE_ADMINISTRATION)

IRODS_FEATURE(IRODS_HAS_API_ENDPOINT_SWITCH_USER)
IRODS_FEATURE(IRODS_LIBRARY_FEATURE_API_ENDPOINT_SWITCH_USER)

IRODS_FEATURE(IRODS_HAS_LIBRARY_SYSTEM_ERROR)
IRODS_FEATURE(IRODS_LIBRARY_FEATURE_LIBRARY_SYSTEM_ERROR)

IRODS_FEATURE(IRODS_HAS_FEATURE_PROXY_USER_SUPPORT_FOR_CLIENT_CONNECTION_LIBRARIES)
IRODS_FEATURE(IRODS_LIBRARY_FEATURE_PROXY_USER_SUPPORT_FOR_CLIENT_CONNECTION_LIBRARIES)

IRODS_FEATURE(IRODS_HAS_API_ENDPOINT_CHECK_AUTH_CREDENTIALS)
IRODS_FEATURE(IRODS_LIBRARY_FEATURE_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_API_ENDPOINT_REPLICA_TRUNCATE)

IRODS_FEATURE(IRODS_LIBRARY_FEATURE_API_ENDPOINT_GENQUERY2)
}.dump().c_str());
// clang-format on

Expand Down
16 changes: 15 additions & 1 deletion unit_tests/src/test_rc_get_library_features.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,27 @@ TEST_CASE("rc_get_library_features")

// clang-format off
CHECK(202209 == features.at(IRODS_TO_STRING(IRODS_HAS_LIBRARY_TICKET_ADMINISTRATION)).get<int>());
CHECK(202209 == features.at(IRODS_TO_STRING(IRODS_LIBRARY_FEATURE_LIBRARY_TICKET_ADMINISTRATION)).get<int>());

CHECK(202210 == features.at(IRODS_TO_STRING(IRODS_HAS_LIBRARY_ZONE_ADMINISTRATION)).get<int>());
CHECK(202210 == features.at(IRODS_TO_STRING(IRODS_LIBRARY_FEATURE_LIBRARY_ZONE_ADMINISTRATION)).get<int>());

CHECK(202211 == features.at(IRODS_TO_STRING(IRODS_HAS_API_ENDPOINT_SWITCH_USER)).get<int>());
CHECK(202211 == features.at(IRODS_TO_STRING(IRODS_LIBRARY_FEATURE_API_ENDPOINT_SWITCH_USER)).get<int>());

CHECK(202301 == features.at(IRODS_TO_STRING(IRODS_HAS_LIBRARY_SYSTEM_ERROR)).get<int>());
CHECK(202301 == features.at(IRODS_TO_STRING(IRODS_LIBRARY_FEATURE_LIBRARY_SYSTEM_ERROR)).get<int>());

CHECK(202306 == features.at(IRODS_TO_STRING(IRODS_HAS_FEATURE_PROXY_USER_SUPPORT_FOR_CLIENT_CONNECTION_LIBRARIES)).get<int>());
CHECK(202306 == features.at(IRODS_TO_STRING(IRODS_LIBRARY_FEATURE_PROXY_USER_SUPPORT_FOR_CLIENT_CONNECTION_LIBRARIES)).get<int>());

CHECK(202307 == features.at(IRODS_TO_STRING(IRODS_HAS_API_ENDPOINT_CHECK_AUTH_CREDENTIALS)).get<int>());
CHECK(202307 == features.at(IRODS_TO_STRING(IRODS_LIBRARY_FEATURE_API_ENDPOINT_CHECK_AUTH_CREDENTIALS)).get<int>());

CHECK(202403 == features.at(IRODS_TO_STRING(IRODS_HAS_API_ENDPOINT_REPLICA_TRUNCATE)).get<int>());
CHECK(202403 == features.at(IRODS_TO_STRING(IRODS_HAS_API_ENDPOINT_GENQUERY2)).get<int>());
CHECK(202403 == features.at(IRODS_TO_STRING(IRODS_LIBRARY_FEATURE_API_ENDPOINT_REPLICA_TRUNCATE)).get<int>());

CHECK(202404 == features.at(IRODS_TO_STRING(IRODS_LIBRARY_FEATURE_API_ENDPOINT_GENQUERY2)).get<int>());
// clang-format on
}

Expand Down

0 comments on commit fe39e00

Please sign in to comment.