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 Oct 4, 2024
1 parent ec0d63a commit d3a27ff
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 19 deletions.
39 changes: 23 additions & 16 deletions test/testframe.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ AddTest(const char *TestName, void (*TestFunc)(const void *), void (*TestSetupFu
}
if (strlen(TestName) >= MAXTESTNAME) {
if (TestFrameworkProcessID_g == 0)
fprintf(stderr, "%s: test name ('%s') too long, increase MAXTESTNAME(%d).\n", __func__,
TestName, MAXTESTNAME);
fprintf(stderr, "%s: test name ('%s') too long, increase MAXTESTNAME(%d).\n", __func__, TestName,
MAXTESTNAME);
return FAIL;
}
if (strlen(TestDescr) >= MAXTESTDESC) {
if (TestFrameworkProcessID_g == 0)
fprintf(stderr, "%s: test description ('%s') too long, increase MAXTESTDESC(%d).\n",
__func__, TestDescr, MAXTESTDESC);
fprintf(stderr, "%s: test description ('%s') too long, increase MAXTESTDESC(%d).\n", __func__,
TestDescr, MAXTESTDESC);
return FAIL;
}
if ((TestData && (0 == TestDataSize)) || (!TestData && (0 != TestDataSize))) {
Expand All @@ -95,8 +95,9 @@ AddTest(const char *TestName, void (*TestFunc)(const void *), void (*TestSetupFu

if (NULL == (newTest = realloc(TestArray, newAlloc * sizeof(TestStruct)))) {
if (TestFrameworkProcessID_g == 0)
fprintf(stderr, "%s: couldn't reallocate test array, TestCount = %u, TestAlloc = %u, newAlloc = %u\n",
__func__, TestCount, TestAlloc, newAlloc);
fprintf(stderr,
"%s: couldn't reallocate test array, TestCount = %u, TestAlloc = %u, newAlloc = %u\n",
__func__, TestCount, TestAlloc, newAlloc);
return FAIL;
}

Expand Down Expand Up @@ -142,9 +143,8 @@ AddTest(const char *TestName, void (*TestFunc)(const void *), void (*TestSetupFu
*/
herr_t
TestInit(const char *ProgName, void (*TestPrivateUsage)(FILE *stream),
herr_t (*TestPrivateParser)(int argc, char *argv[]),
herr_t (*TestSetupFunc)(void), herr_t (*TestCleanupFunc)(void),
int TestProcessID)
herr_t (*TestPrivateParser)(int argc, char *argv[]), herr_t (*TestSetupFunc)(void),
herr_t (*TestCleanupFunc)(void), int TestProcessID)
{
/* Turn off automatic error reporting if requested */
if (!TestEnableErrorStack) {
Expand Down Expand Up @@ -356,19 +356,23 @@ TestParseCmdLine(int argc, char *argv[])
max_threads = strtol(*argv, NULL, 10);
if (errno != 0) {
if (TestFrameworkProcessID_g == 0)
fprintf(stderr, "error while parsing value (%s) specified for maximum number of threads\n", *argv);
fprintf(stderr,
"error while parsing value (%s) specified for maximum number of threads\n",
*argv);
ret_value = FAIL;
goto done;
}
if (max_threads <= 0) {
if (TestFrameworkProcessID_g == 0)
fprintf(stderr, "invalid value (%ld) specified for maximum number of threads\n", max_threads);
fprintf(stderr, "invalid value (%ld) specified for maximum number of threads\n",
max_threads);
ret_value = FAIL;
goto done;
}
else if (max_threads > (long)INT_MAX) {
if (TestFrameworkProcessID_g == 0)
fprintf(stderr, "value (%ld) specified for maximum number of threads too large\n", max_threads);
fprintf(stderr, "value (%ld) specified for maximum number of threads too large\n",
max_threads);
ret_value = FAIL;
goto done;
}
Expand Down Expand Up @@ -420,7 +424,7 @@ PerformTests(void)

if (TestAlarmOn() < 0)
MESSAGE(5, ("Couldn't enable test alarm timer for test -- %s (%s) \n",
TestArray[Loop].Description, TestArray[Loop].Name));
TestArray[Loop].Description, TestArray[Loop].Name));

if (TestArray[Loop].TestSetupFunc)
TestArray[Loop].TestSetupFunc(TestArray[Loop].TestParameters);
Expand Down Expand Up @@ -631,7 +635,8 @@ ParseTestVerbosity(char *argv)
verb_level = strtol(argv, NULL, 10);
if (errno != 0) {
if (TestFrameworkProcessID_g == 0)
fprintf(stderr, "%s: error while parsing value (%s) specified for test verbosity\n", __func__, argv);
fprintf(stderr, "%s: error while parsing value (%s) specified for test verbosity\n", __func__,
argv);
return FAIL;
}

Expand Down Expand Up @@ -786,12 +791,14 @@ TestAlarmOn(void)
alarm_sec = strtoul(env_val, NULL, 10);
if (errno != 0) {
if (TestFrameworkProcessID_g == 0)
fprintf(stderr, "%s: error while parsing value (%s) specified for alarm timeout\n", __func__, env_val);
fprintf(stderr, "%s: error while parsing value (%s) specified for alarm timeout\n", __func__,
env_val);
return FAIL;
}
else if (alarm_sec > (unsigned long)UINT_MAX) {
if (TestFrameworkProcessID_g == 0)
fprintf(stderr, "%s: value (%lu) specified for alarm timeout too large\n", __func__, alarm_sec);
fprintf(stderr, "%s: value (%lu) specified for alarm timeout too large\n", __func__,
alarm_sec);
return FAIL;
}
}
Expand Down
5 changes: 2 additions & 3 deletions test/testframe.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,8 @@ extern "C" {
*
*/
H5TEST_DLL herr_t TestInit(const char *ProgName, void (*TestPrivateUsage)(FILE *stream),
int (*TestPrivateParser)(int argc, char *argv[]),
herr_t (*TestSetupFunc)(void), herr_t (*TestCleanupFunc)(void),
int TestProcessID);
int (*TestPrivateParser)(int argc, char *argv[]), herr_t (*TestSetupFunc)(void),
herr_t (*TestCleanupFunc)(void), int TestProcessID);

/**
* --------------------------------------------------------------------------
Expand Down

0 comments on commit d3a27ff

Please sign in to comment.