Skip to content

Commit

Permalink
Committing clang-format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Dec 17, 2024
1 parent 196ab1d commit 5652aa0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 18 deletions.
9 changes: 5 additions & 4 deletions src/H5FDs3comms.c
Original file line number Diff line number Diff line change
Expand Up @@ -1860,8 +1860,8 @@ H5FD__s3comms_load_aws_creds_from_file(FILE *file, const char *profile_name, cha
*
*/
static herr_t
H5FD__s3comms_load_aws_creds_from_env(char *key_id, char *secret_access_key,
char *session_token, char *aws_region)
H5FD__s3comms_load_aws_creds_from_env(char *key_id, char *secret_access_key, char *session_token,
char *aws_region)
{
herr_t ret_value = SUCCEED;
char *key_id_env = NULL;
Expand Down Expand Up @@ -1945,7 +1945,7 @@ H5FD__s3comms_load_aws_creds_from_env(char *key_id, char *secret_access_key,
*/
herr_t
H5FD_s3comms_load_aws_profile(const char *profile_name, char *key_id_out, char *secret_access_key_out,
char *session_token_out, char *aws_region_out)
char *session_token_out, char *aws_region_out)
{
herr_t ret_value = SUCCEED;
FILE *credfile = NULL;
Expand Down Expand Up @@ -1995,7 +1995,8 @@ H5FD_s3comms_load_aws_profile(const char *profile_name, char *key_id_out, char *
/* Check for credentials in environment variables. Environment variables will override
* credentials from credentials/config files and just load them if there were none in
* the files. */
ret_value = H5FD__s3comms_load_aws_creds_from_env(key_id_out, secret_access_key_out, session_token_out, aws_region_out);
ret_value = H5FD__s3comms_load_aws_creds_from_env(key_id_out, secret_access_key_out, session_token_out,
aws_region_out);

/* fail if not all three settings were loaded */
if (*key_id_out == 0 || *secret_access_key_out == 0 || *aws_region_out == 0)
Expand Down
4 changes: 2 additions & 2 deletions test/ros3.c
Original file line number Diff line number Diff line change
Expand Up @@ -1104,8 +1104,8 @@ main(void)

/* Attempt to load test credentials - if unable, certain tests will be skipped */
if (SUCCEED == H5FD_s3comms_load_aws_profile(S3_TEST_PROFILE_NAME, s3_test_aws_access_key_id,
s3_test_aws_secret_access_key,
s3_test_aws_session_token, s3_test_aws_region)) {
s3_test_aws_secret_access_key, s3_test_aws_session_token,
s3_test_aws_region)) {
s3_test_credentials_loaded = 1;
strncpy(restricted_access_fa.aws_region, (const char *)s3_test_aws_region, H5FD_ROS3_MAX_REGION_LEN);
strncpy(restricted_access_fa.secret_id, (const char *)s3_test_aws_access_key_id,
Expand Down
22 changes: 10 additions & 12 deletions test/s3comms.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
*/
static int s3_test_credentials_loaded = 0;
static char s3_test_aws_region[16] = "";
static char s3_test_aws_access_key_id[128] = "";
static char s3_test_aws_access_key_id[128] = "";
static char s3_test_aws_secret_access_key[128] = "";
static char s3_test_aws_session_token[4096] = "";
static char s3_test_aws_session_token[4096] = "";
static char s3_test_bucket_url[S3_TEST_MAX_URL_SIZE] = "";
static bool s3_test_bucket_defined = false;

Expand Down Expand Up @@ -1647,12 +1647,12 @@ test_s3r_read(void)
TEST_ERROR;

if (handle != NULL)
/*****************************
* Tests that should succeed *
*****************************/
/*****************************
* Tests that should succeed *
*****************************/

/* Read from start of file */
memset(buffer, 0, S3COMMS_READ_BUFFER_SIZE);
/* Read from start of file */
memset(buffer, 0, S3COMMS_READ_BUFFER_SIZE);
if (H5FD_s3comms_s3r_read(handle, (haddr_t)0, (size_t)118, buffer) < 0)
TEST_ERROR;
if (strcmp("Once upon a midnight dreary, while I pondered, weak and weary,\n"
Expand Down Expand Up @@ -1768,7 +1768,7 @@ main(void)
/* "clear" profile data strings */
s3_test_aws_access_key_id[0] = '\0';
s3_test_aws_secret_access_key[0] = '\0';
s3_test_aws_session_token[0] = '\0';
s3_test_aws_session_token[0] = '\0';
s3_test_aws_region[0] = '\0';
s3_test_bucket_url[0] = '\0';

Expand All @@ -1779,10 +1779,8 @@ main(void)
/* attempt to load test credentials
* if unable, certain tests will be skipped
*/
if (SUCCEED == H5FD_s3comms_load_aws_profile(S3_TEST_PROFILE_NAME,
s3_test_aws_access_key_id,
s3_test_aws_secret_access_key,
s3_test_aws_session_token,
if (SUCCEED == H5FD_s3comms_load_aws_profile(S3_TEST_PROFILE_NAME, s3_test_aws_access_key_id,
s3_test_aws_secret_access_key, s3_test_aws_session_token,
s3_test_aws_region)) {
s3_test_credentials_loaded = 1;
}
Expand Down

0 comments on commit 5652aa0

Please sign in to comment.