Straggler from last commit: make TESTING() take printf-like varargs

arguments.
This commit is contained in:
David Young
2019-09-23 10:34:01 -05:00
parent b474650645
commit 0880c57d13
2 changed files with 13 additions and 1 deletions

View File

@@ -129,6 +129,17 @@ h5_errors(hid_t estack, void H5_ATTR_UNUSED *client_data)
return 0;
}
void
h5_testing(const char *fmt, ...)
{
va_list ap;
char buf[62 + 1]; /* room for 62-char field + NUL */
va_start(ap, fmt);
vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
printf("Testing %s", buf);
fflush(stdout);
}
/*-------------------------------------------------------------------------
* Function: h5_clean_files

View File

@@ -101,7 +101,7 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */
* spaces. If the h5_errors() is used for automatic error handling then
* the H5_FAILED() macro is invoked automatically when an API function fails.
*/
#define TESTING(WHAT) {printf("Testing %-62s",WHAT); fflush(stdout);}
#define TESTING(...) h5_testing(__VA_ARGS__);
#define TESTING_2(WHAT) {printf(" Testing %-62s",WHAT); fflush(stdout);}
#define PASSED() {puts(" PASSED");fflush(stdout);}
#define H5_FAILED() {puts("*FAILED*");fflush(stdout);}
@@ -126,6 +126,7 @@ extern "C" {
#endif
/* Generally useful testing routines */
H5TEST_DLL void h5_testing(const char *, ...);
H5TEST_DLL void h5_clean_files(const char *base_name[], hid_t fapl);
H5TEST_DLL int h5_cleanup(const char *base_name[], hid_t fapl);
H5TEST_DLL char *h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size);