if (&creds_union) { release_v5_creds_union(&creds_union); }
// try with bad params
- check_once_cc_ccache_store_credentials(ccache, NULL, ccErrInvalidCredentials, "NULL creds param");
+ check_once_cc_ccache_store_credentials(ccache, NULL, ccErrBadParam, "NULL creds param");
// invalid creds
if (!err) {
free(creds_union.credentials.credentials_v5->client);
creds_union.credentials.credentials_v5->client = NULL;
}
- check_once_cc_ccache_store_credentials(ccache, &creds_union, ccErrInvalidCredentials, "invalid creds (NULL client string)");
+ check_once_cc_ccache_store_credentials(ccache, &creds_union, ccErrBadParam, "invalid creds (NULL client string)");
}
if (&creds_union) { release_v5_creds_union(&creds_union); }
cc_credentials_iterator_t creds_iterator = NULL;
cc_credentials_t creds = NULL;
- cc_int32 possible_return_values[5] = {
+ cc_int32 possible_return_values[6] = {
ccNoError,
+ ccErrBadParam,
ccErrInvalidCCache,
ccErrInvalidCredentials,
ccErrBadCredentialsVersion,
}
// NULL param
- check_once_cc_ccache_remove_credentials(ccache, NULL, ccErrInvalidCredentials, "NULL creds in param");
+ check_once_cc_ccache_remove_credentials(ccache, NULL, ccErrBadParam, "NULL creds in param");
// non-existent creds (remove same one twice)
- check_once_cc_ccache_remove_credentials(ccache, creds_array[0], ccErrCredentialsNotFound, "removed same creds twice");
+ check_once_cc_ccache_remove_credentials(ccache, creds_array[0], ccErrInvalidCredentials, "removed same creds twice");
// non-existent ccache
if (ccache) {
cc_credentials_iterator_t creds_iterator = NULL;
cc_credentials_t creds = NULL;
- cc_int32 possible_return_values[5] = {
+ cc_int32 possible_return_values[6] = {
ccNoError,
+ ccErrBadParam,
ccErrInvalidCCache,
ccErrInvalidCredentials,
ccErrCredentialsNotFound,
}
if (!err) {
- check_once_cc_ccache_new_credentials_iterator(ccache, &creds_iterator, ccErrCCacheNotFound, "invalid ccache");
+ check_once_cc_ccache_new_credentials_iterator(ccache, &creds_iterator, ccErrInvalidCCache, "invalid ccache");
}
if (creds_iterator) {
cc_int32 check_once_cc_ccache_new_credentials_iterator(cc_ccache_t ccache, cc_credentials_iterator_t *iterator, cc_int32 expected_err, const char *description) {
cc_int32 err = ccNoError;
- cc_int32 possible_return_values[4] = {
+ cc_int32 possible_return_values[5] = {
ccNoError,
ccErrBadParam,
ccErrNoMem,
ccErrCCacheNotFound,
+ ccErrInvalidCCache,
};
BEGIN_CHECK_ONCE(description);
}
if (!err) {
- check_once_cc_ccache_get_last_default_time(ccache_1, &last_time_1, ccErrCCacheNotFound, "destroyed ccache");
+ check_once_cc_ccache_get_last_default_time(ccache_1, &last_time_1, ccErrInvalidCCache, "destroyed ccache");
}
if (ccache_1) { cc_ccache_release(ccache_1); }
// NULL param
if (!err) {
- check_once_cc_ccache_move(destination, NULL, ccErrInvalidCCache, "NULL destination param");
+ check_once_cc_ccache_move(destination, NULL, ccErrBadParam, "NULL destination param");
}
// non-existent ccache
cc_string_t src_principal = NULL;
cc_string_t dst_principal = NULL;
- cc_int32 possible_return_values[3] = {
+ cc_int32 possible_return_values[4] = {
ccNoError,
+ ccErrBadParam,
ccErrInvalidCCache,
ccErrCCacheNotFound,
};
}
equal = 0;
check_once_cc_ccache_compare(ccache_a, ccache_b, &equal, ccNoError, "compare different ccaches");
- check_once_cc_ccache_compare(ccache_a, NULL, &equal, ccErrInvalidCCache, "NULL compare_to ccache");
+ check_once_cc_ccache_compare(ccache_a, NULL, &equal, ccErrBadParam, "NULL compare_to ccache");
check_once_cc_ccache_compare(ccache_a, ccache_b, NULL, ccErrBadParam, "NULL out param");
if (ccache_a) { cc_ccache_release(ccache_a); }
BEGIN_TEST("cc_initialize");
// try every api_version
- err = check_once_cc_initialize(&context, ccapi_version_2, NULL, NULL, 11, NULL); // err == CC_NOT_SUPP, not reflected in documentation rev 8
- err = check_once_cc_initialize(&context, ccapi_version_3, NULL, NULL, ccNoError, NULL); // !err
- err = check_once_cc_initialize(&context, ccapi_version_4, NULL, NULL, ccNoError, NULL); // "
- err = check_once_cc_initialize(&context, ccapi_version_5, NULL, NULL, ccNoError, NULL); // "
- err = check_once_cc_initialize(&context, ccapi_version_6, NULL, NULL, ccNoError, NULL); // "
+ err = check_once_cc_initialize(&context, ccapi_version_2, NULL, NULL, 11, "cc_initialize with ccapi_version_2"); // err == CC_NOT_SUPP, not reflected in documentation rev 8
+ err = check_once_cc_initialize(&context, ccapi_version_3, NULL, NULL, ccNoError, "cc_initialize with ccapi_version_3"); // !err
+ err = check_once_cc_initialize(&context, ccapi_version_4, NULL, NULL, ccNoError, "cc_initialize with ccapi_version_4"); // "
+ err = check_once_cc_initialize(&context, ccapi_version_5, NULL, NULL, ccNoError, "cc_initialize with ccapi_version_5"); // "
+ err = check_once_cc_initialize(&context, ccapi_version_6, NULL, NULL, ccNoError, "cc_initialize with ccapi_version_6"); // "
// try bad api_version
err = check_once_cc_initialize(&context, INT_MAX, NULL, NULL, ccErrBadAPIVersion, NULL); // err == ccErrBadAPIVersion
}
// try bad parameters
- err = check_once_cc_context_create_ccache(context, NULL, cc_credentials_v5, "foo@BAR.ORG", &ccache, ccErrBadName, "NULL name"); // NULL name
+ err = check_once_cc_context_create_ccache(context, NULL, cc_credentials_v5, "foo@BAR.ORG", &ccache, ccErrBadParam, "NULL name"); // NULL name
err = check_once_cc_context_create_ccache(context, "name", cc_credentials_v4_v5, "foo@BAR.ORG", &ccache, ccErrBadCredentialsVersion, "invalid creds_vers"); // invalid creds_vers
err = check_once_cc_context_create_ccache(context, "name", cc_credentials_v5, NULL, &ccache, ccErrBadParam, "NULL principal"); // NULL principal
err = check_once_cc_context_create_ccache(context, "name", cc_credentials_v5, "foo@BAR.ORG", NULL, ccErrBadParam, "NULL ccache"); // NULL ccache
check_once_cc_context_compare(context_a, context_a, &equal, ccNoError, "valid params, same contexts");
check_once_cc_context_compare(context_a, context_b, &equal, ccNoError, "valid params, different contexts");
- check_once_cc_context_compare(context_a, NULL, &equal, ccErrInvalidContext, "NULL compare_to context");
+ check_once_cc_context_compare(context_a, NULL, &equal, ccErrBadParam, "NULL compare_to context");
check_once_cc_context_compare(context_a, context_b, NULL, ccErrBadParam, "NULL out param");
if (context_a) { cc_context_release(context_a); }