Skip to content

Commit

Permalink
gh-674: Update celix_rsa_utils documentation and add corresponding te…
Browse files Browse the repository at this point in the history
…st case.
  • Loading branch information
PengZheng committed Mar 29, 2024
1 parent 81ee259 commit e082a65
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions bundles/remote_services/rsa_utils/gtest/src/RsaUtilsTestSuite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ TEST_F(RsaUtilsTestSuite, CreateServicePropertiesFromEndpointPropertiesTest) {
EXPECT_STREQ("", celix_version_getQualifier(entry->typed.versionValue));
}

TEST_F(RsaUtilsTestSuite, CreateServicePropertiesFromEndpointPropertiesWithInvalidVersionTest) {
celix_autoptr(celix_properties_t) endpointProperties = celix_properties_create();
celix_properties_set(endpointProperties, CELIX_FRAMEWORK_SERVICE_RANKING, "10");
celix_properties_set(endpointProperties, CELIX_FRAMEWORK_SERVICE_VERSION, "invalid");

celix_autoptr(celix_properties_t) serviceProperties = nullptr;
celix_status_t status =
celix_rsaUtils_createServicePropertiesFromEndpointProperties(endpointProperties, &serviceProperties);
ASSERT_EQ(status, CELIX_ILLEGAL_ARGUMENT);
ASSERT_TRUE(serviceProperties == nullptr);
}

TEST_F(RsaUtilsTestSuite, CreateServicePropertiesFromEndpointPropertiesWithNullArgTest) {
// NULL argument will result in an empty service properties set
celix_autoptr(celix_properties_t) serviceProperties = nullptr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extern "C" {
*
* @param[in] endpointProperties
* @param[out] serviceProperties
* @return CELIX_SUCCESS if successfully, CELIX_ENOMEM if out of memory.
* @return CELIX_SUCCESS if successfully, CELIX_ENOMEM if out of memory, and CELIX_ILLEGAL_ARGUMENT for invalid "service version".
*/
celix_status_t
celix_rsaUtils_createServicePropertiesFromEndpointProperties(const celix_properties_t* endpointProperties,
Expand Down

0 comments on commit e082a65

Please sign in to comment.