summaryrefslogtreecommitdiffstats
path: root/test/flush1.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-11-23 20:40:35 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-11-23 20:40:35 (GMT)
commitdedc8c37b4fd21a657313a6ecd43318fa4b0fa5c (patch)
treec7ba6d465bfe7ccf19bbac452d81d40358f9241b /test/flush1.c
parentae8f25bd43666b75275f6cb9e2bf0c084f8cea5e (diff)
downloadhdf5-dedc8c37b4fd21a657313a6ecd43318fa4b0fa5c.zip
hdf5-dedc8c37b4fd21a657313a6ecd43318fa4b0fa5c.tar.gz
hdf5-dedc8c37b4fd21a657313a6ecd43318fa4b0fa5c.tar.bz2
[svn-r944] Changes since 19981120
---------------------- ./MANIFEST ./test/Makefile.in ./test/shtype.c [REMOVED] Removed shtype.c because it was all commented out. Besides, these tests are done in dtypes.c now anyway. ./test/external.c ./test/fillval.c ./test/flush1.c ./test/flush2.c ./test/links.c ./test/mount.c ./test/mtime.c ./test/unlink.c The tests that check the HDF5 API use the h5test support functions. For one thing, that means that you can specify the file driver that thay use by the HDF5_DRIVER environment variable. Possible values are: HDF5_DRIVER='sec2' Use read() and write() HDF5_DRIVER='stdio' Use fread() and fwrite() HDF5_DRIVER='core' Use malloc() and free() HDF5_DRIVER='split' Split meta and raw data HDF5_DRIVER='family N' Use file families with each member being N megabytes (N can be fractional, defaults to one). Some tests might fail for certain drivers: for instance, the mount and link tests fail for the `core' driver because they must be able to close and then reopen a file.
Diffstat (limited to 'test/flush1.c')
-rw-r--r--test/flush1.c75
1 files changed, 15 insertions, 60 deletions
diff --git a/test/flush1.c b/test/flush1.c
index f353100..7ffcec3 100644
--- a/test/flush1.c
+++ b/test/flush1.c
@@ -11,57 +11,12 @@
* calling _exit(0) since this doesn't flush HDF5 caches but
* still exits with success.
*/
+#include <h5test.h>
-/* See H5private.h for how to include headers */
-#undef NDEBUG
-#include <hdf5.h>
-
-#ifdef STDC_HEADERS
-# include <stdio.h>
-# include <stdlib.h>
-#endif
-
-#ifdef HAVE_UNISTD_H
-# include <sys/types.h>
-# include <unistd.h>
-#endif
-
-#ifndef HAVE_ATTRIBUTE
-# undef __attribute__
-# define __attribute__(X) /*void*/
-# define __unused__ /*void*/
-#else
-# define __unused__ __attribute__((unused))
-#endif
-
-
-#define FILE_NAME_1 "flush.h5" /*do not clean up*/
-
-
-
-/*-------------------------------------------------------------------------
- * Function: display_error_cb
- *
- * Purpose: Displays the error stack after printing "*FAILED*".
- *
- * Return: Success: 0
- *
- * Failure: -1
- *
- * Programmer: Robb Matzke
- * Wednesday, March 4, 1998
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-display_error_cb (void __unused__ *client_data)
-{
- puts ("*FAILED*");
- H5Eprint (stdout);
- return 0;
-}
+const char *FILENAME[] = {
+ "flush",
+ NULL
+};
/*-------------------------------------------------------------------------
@@ -83,20 +38,21 @@ display_error_cb (void __unused__ *client_data)
int
main(void)
{
- hid_t file, dcpl, space, dset, groups, grp;
+ hid_t fapl, file, dcpl, space, dset, groups, grp;
hsize_t ds_size[2] = {100, 100};
hsize_t ch_size[2] = {5, 5};
double the_data[100][100];
hsize_t i, j;
- char name[256];
+ char name[1024];
- printf("%-70s", "Testing H5Fflush (part1)");
- fflush(stdout);
- H5Eset_auto(display_error_cb, NULL);
+ h5_reset();
+ fapl = h5_fileaccess();
+
+ TESTING("H5Fflush (part1)");
/* Create the file */
- if ((file=H5Fcreate(FILE_NAME_1, H5F_ACC_TRUNC,
- H5P_DEFAULT, H5P_DEFAULT))<0) goto error;
+ h5_fixname(FILENAME[0], fapl, name, sizeof name);
+ if ((file=H5Fcreate(name, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) goto error;
/* Create a chunked dataset */
if ((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
@@ -129,14 +85,13 @@ main(void)
/* Flush and exit without closing the library */
if (H5Fflush(file, H5F_SCOPE_GLOBAL)<0) goto error;
- puts(" PASSED");
+ PASSED();
fflush(stdout);
fflush(stderr);
_exit(0);
error:
- printf("*FAILED*");
- return 1;
+ _exit(1);
}