Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove duplicate MESSAGE macro #5200

Merged
merged 1 commit into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions c++/test/h5cpputil.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ using namespace H5;
using std::cerr;
using std::endl;

#define MESSAGE(V, A) \
do { \
if (GetTestVerbosity() > (V)) \
printf A; \
} while (0)
#define SUBTEST(TEST) \
do { \
printf(" Subtest: %-52s", TEST); \
Expand Down
9 changes: 9 additions & 0 deletions test/testframe.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,15 @@ TestShutdown(void)
return SUCCEED;
}

/*
* Retrieve the MPI rank for this process.
*/
H5_ATTR_PURE int
GetTestFrameworkProcessID(void)
{
return TestFrameworkProcessID_g;
}

/*
* Retrieve the verbosity level for the testing framework
*/
Expand Down
29 changes: 20 additions & 9 deletions test/testframe.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,16 @@
* Verbose queries
* Only None needs an exact match. The rest are at least as much.
*/
#define VERBOSE_NONE (TestVerbosity_g == VERBO_NONE)
#define VERBOSE_DEF (TestVerbosity_g >= VERBO_DEF)
#define VERBOSE_LO (TestVerbosity_g >= VERBO_LO)
#define VERBOSE_MED (TestVerbosity_g >= VERBO_MED)
#define VERBOSE_HI (TestVerbosity_g >= VERBO_HI)
#define VERBOSE_NONE (GetTestVerbosity() == VERBO_NONE)
#define VERBOSE_DEF (GetTestVerbosity() >= VERBO_DEF)
#define VERBOSE_LO (GetTestVerbosity() >= VERBO_LO)
#define VERBOSE_MED (GetTestVerbosity() >= VERBO_MED)
#define VERBOSE_HI (GetTestVerbosity() >= VERBO_HI)

/* Used to document process through a test */
#define MESSAGE(V, A) \
do { \
if (TestFrameworkProcessID_g == 0 && TestVerbosity_g > (V)) \
if (GetTestFrameworkProcessID() == 0 && GetTestVerbosity() > (V)) \
printf A; \
} while (0)

Expand All @@ -112,9 +112,6 @@
/* Variables */
/*************/

H5TEST_DLLVAR int TestFrameworkProcessID_g;
H5TEST_DLLVAR int TestVerbosity_g;

/**************/
/* Prototypes */
/**************/
Expand Down Expand Up @@ -422,6 +419,20 @@ H5TEST_DLL herr_t PerformTests(void);
*/
H5TEST_DLL void TestSummary(FILE *stream);

/**
* --------------------------------------------------------------------------
* \ingroup H5TEST
*
* \brief Returns the MPI rank for this process
*
* \return The MPI rank of this process
*
* \details GetTestFrameworkProcessID() returns the MPI rank for this process.
* Always returns rank 0 in serial HDF5.
*
*/
H5TEST_DLL int GetTestFrameworkProcessID(void);

/**
* --------------------------------------------------------------------------
* \ingroup H5TEST
Expand Down
Loading