summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2019-09-23 15:34:01 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2019-09-23 15:34:01 (GMT)
commit0880c57d13ee2b3811ac22e7efdbc0130448e6bb (patch)
treea59999d03f3ade30b14927258079adb81301cd6a
parentb4746506450a9202c18f532a66be36bedb7f6cca (diff)
downloadhdf5-0880c57d13ee2b3811ac22e7efdbc0130448e6bb.zip
hdf5-0880c57d13ee2b3811ac22e7efdbc0130448e6bb.tar.gz
hdf5-0880c57d13ee2b3811ac22e7efdbc0130448e6bb.tar.bz2
Straggler from last commit: make TESTING() take printf-like varargs
arguments.
-rw-r--r--test/h5test.c11
-rw-r--r--test/h5test.h3
2 files changed, 13 insertions, 1 deletions
diff --git a/test/h5test.c b/test/h5test.c
index fb5b83d..ed3e51a 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -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
diff --git a/test/h5test.h b/test/h5test.h
index 8e87192..c5254a7 100644
--- a/test/h5test.h
+++ b/test/h5test.h
@@ -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);