summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/hdfs.c9
-rw-r--r--test/istore.c27
-rw-r--r--test/mirror_vfd.c224
-rw-r--r--test/ntypes.c187
-rw-r--r--test/vfd.c187
5 files changed, 389 insertions, 245 deletions
diff --git a/test/hdfs.c b/test/hdfs.c
index 5465e77..dfaa585 100644
--- a/test/hdfs.c
+++ b/test/hdfs.c
@@ -1448,15 +1448,6 @@ test_noops_and_autofails(void)
H5E_BEGIN_TRY{
JSVERIFY(FAIL, H5FDtruncate(file, H5P_DEFAULT, TRUE), "truncate must fail (closing)")} H5E_END_TRY;
- /* no-op calls to `lock()` and `unlock()`
- */
- JSVERIFY(SUCCEED, H5FDlock(file, TRUE), "lock always succeeds; has no effect")
- JSVERIFY(SUCCEED, H5FDlock(file, FALSE), "lock issue")
- JSVERIFY(SUCCEED, H5FDunlock(file), "unlock issue")
- /* Lock/unlock with null file or similar error crashes tests.
- * HDassert in calling heirarchy, `H5FD[un]lock()` and `H5FD_[un]lock()`
- */
-
/************
* TEARDOWN *
************/
diff --git a/test/istore.c b/test/istore.c
index c75b8bf..f198aad 100644
--- a/test/istore.c
+++ b/test/istore.c
@@ -330,25 +330,6 @@ test_extend(hid_t f, const char *prefix, size_t nx, size_t ny, size_t nz)
}
}
-#if 0
- if (0 == ctr)
- HDfprintf(stderr,"\n");
- HDfprintf(stderr," Insert: ctr=%lu, corner=(%ld", (unsigned long)ctr, (long)offset[0]);
- if (ndims > 1)
- HDfprintf(stderr,",%ld", (long)offset[1]);
- if (ndims > 2)
- HDfprintf(stderr,",%ld", (long)offset[2]);
- HDfprintf(stderr,"), size=(%lu", (unsigned long)size[0]);
- if (ndims > 1)
- HDfprintf(stderr,",%lu", (unsigned long)size[1]);
- if (ndims > 2)
- HDfprintf(stderr,",%lu", (unsigned long)size[2]);
- HDfprintf(stderr,"), %lu element%s", (unsigned long)nelmts, 1 == nelmts ? "" : "s");
- if (0 == nelmts)
- HDfprintf(stderr," *SKIPPED*");
- HDfprintf(stderr,"\n");
-#endif
-
/* Fill the source array */
if (0 == nelmts)
continue;
@@ -478,7 +459,7 @@ test_sparse(hid_t f, const char *prefix, size_t nblocks, size_t nx, size_t ny, s
hsize_t ctr;
char dims[64], s[256], name[256];
hsize_t offset[3];
- hsize_t size[3], total = 0;
+ hsize_t size[3];
uint8_t *buf = NULL;
hsize_t whole_size[3]; /* Size of dataset's dataspace */
size_t u; /* Local index variable */
@@ -503,7 +484,7 @@ test_sparse(hid_t f, const char *prefix, size_t nblocks, size_t nx, size_t ny, s
HDsprintf(s, "istore sparse: %s", dims);
TESTING(s);
if (skip_test) {
- SKIPPED()
+ SKIPPED();
return SUCCEED;
}
buf = (uint8_t *)HDmalloc(nx * ny * nz);
@@ -559,10 +540,6 @@ test_sparse(hid_t f, const char *prefix, size_t nblocks, size_t nx, size_t ny, s
HDprintf(")\n");
goto error;
}
- total += nx * ny * nz;
-#if 0
- HDfprintf(stderr,"ctr: ctr=%Zu, total=%Zu\n", ctr, total);
-#endif
/* We don't test reading yet.... */
}
diff --git a/test/mirror_vfd.c b/test/mirror_vfd.c
index 3556cd2..34a4481 100644
--- a/test/mirror_vfd.c
+++ b/test/mirror_vfd.c
@@ -75,6 +75,25 @@ static unsigned int g_verbosity = DEFAULT_VERBOSITY;
#define MIRR_MESG_SIZE 128
static char mesg[MIRR_MESG_SIZE + 1];
+/* ----------------------------------------------------------------------------
+ * Structure: struct mt_opts
+ *
+ * Purpose: Convenience structure to hold options as parsed from the
+ * command line.
+ *
+ * `portno` (int)
+ * Port number, as received from arguments.
+ *
+ * `ip` (char *)
+ * IP address string as received from arguments.
+ *
+ * ----------------------------------------------------------------------------
+ */
+struct mt_opts {
+ int portno;
+ char ip[H5FD_MIRROR_MAX_IP_LEN + 1];
+};
+
/* Convenience structure for passing file names via helper functions.
*/
struct mirrortest_filenames {
@@ -98,7 +117,8 @@ static herr_t _close_chunking_ids(unsigned min_dset, unsigned max_dset, hid_t *d
static herr_t _populate_filepath(const char *dirname, const char *_basename, hid_t fapl_id, char *path_out,
hbool_t h5suffix);
-static hid_t create_mirroring_split_fapl(const char *_basename, struct mirrortest_filenames *names);
+static hid_t create_mirroring_split_fapl(const char *_basename, struct mirrortest_filenames *names,
+ const struct mt_opts *opts);
static void mybzero(void *dest, size_t size);
@@ -128,7 +148,7 @@ mybzero(void *dest, size_t size)
* Function: _populate_filepath
*
* Purpose: Given a directory name and a base name, concatenate the two and
- * run h5fixname() to get the "actual" path to the intented target.
+ * run h5fixname() to get the "actual" path to the intended target.
* `h5suffix' should be FALSE to keep the base name unaltered;
* TRUE will append the '.h5' h5suffix to the basename...
* FALSE -> h5fixname_no_suffix(), TRUE -> h5fixname()
@@ -1246,7 +1266,8 @@ error:
* ---------------------------------------------------------------------------
*/
static hid_t
-create_mirroring_split_fapl(const char *_basename, struct mirrortest_filenames *names)
+create_mirroring_split_fapl(const char *_basename, struct mirrortest_filenames *names,
+ const struct mt_opts *opts)
{
H5FD_splitter_vfd_config_t splitter_config;
H5FD_mirror_fapl_t mirror_conf;
@@ -1274,8 +1295,8 @@ create_mirroring_split_fapl(const char *_basename, struct mirrortest_filenames *
*/
mirror_conf.magic = H5FD_MIRROR_FAPL_MAGIC;
mirror_conf.version = H5FD_MIRROR_CURR_FAPL_T_VERSION;
- mirror_conf.handshake_port = SERVER_HANDSHAKE_PORT;
- if (HDstrncpy(mirror_conf.remote_ip, SERVER_IP_ADDRESS, H5FD_MIRROR_MAX_IP_LEN) == NULL) {
+ mirror_conf.handshake_port = opts->portno;
+ if (HDstrncpy(mirror_conf.remote_ip, opts->ip, H5FD_MIRROR_MAX_IP_LEN) == NULL) {
TEST_ERROR;
}
splitter_config.wo_fapl_id = H5Pcreate(H5P_FILE_ACCESS);
@@ -1354,7 +1375,7 @@ error:
* ---------------------------------------------------------------------------
*/
static int
-test_create_and_close(void)
+test_create_and_close(const struct mt_opts *opts)
{
struct mirrortest_filenames names;
hid_t file_id = H5I_INVALID_HID;
@@ -1364,7 +1385,7 @@ test_create_and_close(void)
/* Create FAPL for Splitter[sec2|mirror]
*/
- fapl_id = create_mirroring_split_fapl("basic_create", &names);
+ fapl_id = create_mirroring_split_fapl("basic_create", &names, opts);
if (H5I_INVALID_HID == fapl_id) {
TEST_ERROR;
}
@@ -1889,7 +1910,7 @@ error:
* ---------------------------------------------------------------------------
*/
static int
-test_basic_dataset_write(void)
+test_basic_dataset_write(const struct mt_opts *opts)
{
struct mirrortest_filenames names;
hid_t file_id = H5I_INVALID_HID;
@@ -1906,7 +1927,7 @@ test_basic_dataset_write(void)
/* Create FAPL for Splitter[sec2|mirror]
*/
- fapl_id = create_mirroring_split_fapl("basic_write", &names);
+ fapl_id = create_mirroring_split_fapl("basic_write", &names, opts);
if (H5I_INVALID_HID == fapl_id) {
TEST_ERROR;
}
@@ -2020,7 +2041,7 @@ error:
* ---------------------------------------------------------------------------
*/
static int
-test_chunked_dataset_write(void)
+test_chunked_dataset_write(const struct mt_opts *opts)
{
struct mirrortest_filenames names;
hid_t file_id = H5I_INVALID_HID;
@@ -2030,7 +2051,7 @@ test_chunked_dataset_write(void)
/* Create FAPL for Splitter[sec2|mirror]
*/
- fapl_id = create_mirroring_split_fapl("chunked_write", &names);
+ fapl_id = create_mirroring_split_fapl("chunked_write", &names, opts);
if (H5I_INVALID_HID == fapl_id) {
TEST_ERROR;
}
@@ -2134,7 +2155,7 @@ error:
* ---------------------------------------------------------------------------
*/
static int
-test_on_disk_zoo(void)
+test_on_disk_zoo(const struct mt_opts *opts)
{
const char grp_name[] = "/only";
struct mirrortest_filenames names;
@@ -2146,7 +2167,7 @@ test_on_disk_zoo(void)
/* Create FAPL for Splitter[sec2|mirror]
*/
- fapl_id = create_mirroring_split_fapl("zoo", &names);
+ fapl_id = create_mirroring_split_fapl("zoo", &names, opts);
if (H5I_INVALID_HID == fapl_id) {
TEST_ERROR;
}
@@ -2183,8 +2204,9 @@ test_on_disk_zoo(void)
if (pass) {
validate_zoo(file_id, grp_name, 0); /* sanity-check */
}
+
if (!pass) {
- HDprintf(failure_mssg);
+ HDprintf("%s", failure_mssg);
TEST_ERROR;
}
@@ -2247,15 +2269,14 @@ error:
* ---------------------------------------------------------------------------
*/
static int
-test_vanishing_datasets(void)
+test_vanishing_datasets(const struct mt_opts *opts)
{
struct mirrortest_filenames names;
- hid_t file_id = H5I_INVALID_HID;
- hid_t fapl_id = H5I_INVALID_HID;
- hid_t dset_id = H5I_INVALID_HID;
- hid_t dspace_id = H5I_INVALID_HID;
- hid_t mirror_fapl_id = H5I_INVALID_HID;
- hsize_t dims[2] = {DATABUFFER_SIZE, DATABUFFER_SIZE};
+ hid_t file_id = H5I_INVALID_HID;
+ hid_t fapl_id = H5I_INVALID_HID;
+ hid_t dset_id = H5I_INVALID_HID;
+ hid_t dspace_id = H5I_INVALID_HID;
+ hsize_t dims[2] = {DATABUFFER_SIZE, DATABUFFER_SIZE};
uint32_t buf[DATABUFFER_SIZE][DATABUFFER_SIZE]; /* consider malloc? */
H5G_info_t group_info;
unsigned int i, j, k;
@@ -2269,7 +2290,7 @@ test_vanishing_datasets(void)
/* Create FAPL for Splitter[sec2|mirror]
*/
- fapl_id = create_mirroring_split_fapl("vanishing", &names);
+ fapl_id = create_mirroring_split_fapl("vanishing", &names, opts);
if (H5I_INVALID_HID == fapl_id) {
TEST_ERROR;
}
@@ -2333,7 +2354,7 @@ test_vanishing_datasets(void)
file_id = H5I_INVALID_HID;
/* verify there are no datasets in file */
- file_id = H5Fopen(names.rw, H5F_ACC_RDONLY, H5P_DEFAULT);
+ file_id = H5Fopen(names.rw, H5F_ACC_RDONLY, fapl_id);
if (file_id < 0) {
TEST_ERROR;
}
@@ -2348,7 +2369,7 @@ test_vanishing_datasets(void)
if (H5Fclose(file_id) < 0) {
TEST_ERROR;
}
- file_id = H5Fopen(names.wo, H5F_ACC_RDONLY, H5P_DEFAULT);
+ file_id = H5Fopen(names.wo, H5F_ACC_RDONLY, fapl_id);
if (file_id < 0) {
TEST_ERROR;
}
@@ -2384,21 +2405,10 @@ test_vanishing_datasets(void)
error:
H5E_BEGIN_TRY
{
- if (mirror_fapl_id != H5I_INVALID_HID) {
- H5Pclose(mirror_fapl_id);
- }
- if (fapl_id != H5I_INVALID_HID) {
- H5Pclose(fapl_id);
- }
- if (file_id != H5I_INVALID_HID) {
- H5Fclose(file_id);
- }
- if (dset_id != H5I_INVALID_HID) {
- H5Dclose(dset_id);
- }
- if (dspace_id != H5I_INVALID_HID) {
- H5Sclose(dspace_id);
- }
+ H5Pclose(fapl_id);
+ H5Fclose(file_id);
+ H5Dclose(dset_id);
+ H5Sclose(dspace_id);
}
H5E_END_TRY;
return -1;
@@ -2419,7 +2429,7 @@ error:
* ---------------------------------------------------------------------------
*/
static int
-test_concurrent_access(void)
+test_concurrent_access(const struct mt_opts *opts)
{
struct file_bundle {
struct mirrortest_filenames names;
@@ -2452,7 +2462,7 @@ test_concurrent_access(void)
char _name[16] = "";
hid_t _fapl_id = H5I_INVALID_HID;
HDsnprintf(_name, 15, "concurrent%d", i);
- _fapl_id = create_mirroring_split_fapl(_name, &bundle[i].names);
+ _fapl_id = create_mirroring_split_fapl(_name, &bundle[i].names, opts);
if (H5I_INVALID_HID == _fapl_id) {
TEST_ERROR;
}
@@ -2563,6 +2573,111 @@ error:
return -1;
} /* end test_concurrent_access() */
+/* ----------------------------------------------------------------------------
+ * Function: parse_args
+ *
+ * Purpose: Parse command-line arguments, populating the options struct
+ * pointer as appropriate.
+ * Default values will be set for unspecified options.
+ *
+ * Return: 0 on success, negative (-1) if error.
+ * ----------------------------------------------------------------------------
+ */
+static int
+parse_args(int argc, char **argv, struct mt_opts *opts)
+{
+ int i = 0;
+
+ opts->portno = SERVER_HANDSHAKE_PORT;
+ HDstrncpy(opts->ip, SERVER_IP_ADDRESS, H5FD_MIRROR_MAX_IP_LEN);
+
+ for (i = 1; i < argc; i++) { /* start with first possible option argument */
+ if (!HDstrncmp(argv[i], "--ip=", 5)) {
+ HDstrncpy(opts->ip, argv[i] + 5, H5FD_MIRROR_MAX_IP_LEN);
+ }
+ else if (!HDstrncmp(argv[i], "--port=", 7)) {
+ opts->portno = HDatoi(argv[i] + 7);
+ }
+ else {
+ HDprintf("Unrecognized option: '%s'\n", argv[i]);
+ return -1;
+ }
+ } /* end for each argument from command line */
+
+ /* auto-replace 'localhost' with numeric IP */
+ if (!HDstrncmp(opts->ip, "localhost", 10)) { /* include null terminator */
+ HDstrncpy(opts->ip, "127.0.0.1", H5FD_MIRROR_MAX_IP_LEN);
+ }
+
+ return 0;
+} /* end parse_args() */
+
+/* ----------------------------------------------------------------------------
+ * Function: confirm_server
+ *
+ * Purpose: Create socket and confirm remote server is available.
+ *
+ * Return: 0 on success, negative (-1) if error.
+ * ----------------------------------------------------------------------------
+ */
+static int
+confirm_server(struct mt_opts *opts)
+{
+ char mybuf[16];
+ int live_socket;
+ struct sockaddr_in target_addr;
+ unsigned attempt = 0;
+
+ live_socket = HDsocket(AF_INET, SOCK_STREAM, 0);
+ if (live_socket < 0) {
+ HDprintf("ERROR socket()\n");
+ return -1;
+ }
+
+ target_addr.sin_family = AF_INET;
+ target_addr.sin_port = HDhtons((uint16_t)opts->portno);
+ target_addr.sin_addr.s_addr = HDinet_addr(opts->ip);
+ HDmemset(target_addr.sin_zero, '\0', sizeof(target_addr.sin_zero));
+
+ while (1) {
+ if (HDconnect(live_socket, (struct sockaddr *)&target_addr, (socklen_t)sizeof(target_addr)) < 0) {
+ if (attempt > 10) {
+ HDprintf("ERROR connect() (%d)\n%s\n", errno, HDstrerror(errno));
+ return -1;
+ }
+ attempt++;
+ HDsleep(1);
+ HDprintf("attempt #%u: ERROR connect() (%d)\n%s\n", attempt, errno, HDstrerror(errno));
+ }
+ else {
+ break;
+ }
+ }
+
+ /* Request confirmation from the server */
+ if (HDwrite(live_socket, "CONFIRM", 8) == -1) {
+ HDprintf("ERROR write() (%d)\n%s\n", errno, HDstrerror(errno));
+ return -1;
+ }
+
+ /* Read & verify response from port connection. */
+ if (HDread(live_socket, &mybuf, sizeof(mybuf)) == -1) {
+ HDprintf("ERROR read() can't receive data\n");
+ return -1;
+ }
+ if (HDstrncmp("ALIVE", mybuf, 6)) {
+ HDprintf("ERROR read() didn't receive data from server\n");
+ return -1;
+ }
+
+ if (HDclose(live_socket) < 0) {
+ HDprintf("ERROR close() can't close socket\n");
+ return -1;
+ }
+
+ return 0;
+} /* end confirm_server() */
+
/* ---------------------------------------------------------------------------
* Function: main
*
@@ -2576,9 +2691,10 @@ error:
* ---------------------------------------------------------------------------
*/
int
-main(void)
+main(int argc, char **argv)
{
- int nerrors = 0;
+ struct mt_opts opts;
+ int nerrors = 0;
h5_reset();
@@ -2602,6 +2718,16 @@ main(void)
}
}
+ if (parse_args(argc, argv, &opts) < 0) {
+ HDprintf("Unable to parse arguments\n");
+ HDexit(EXIT_FAILURE);
+ }
+
+ if (confirm_server(&opts) < 0) {
+ HDprintf("Unable to confirm server is running\n");
+ HDexit(EXIT_FAILURE);
+ }
+
/* -------------------- */
/* TESTS */
/* Tests return negative values; `-=' increments nerrors count */
@@ -2609,12 +2735,12 @@ main(void)
if (nerrors == 0) {
nerrors -= test_fapl_configuration();
nerrors -= test_xmit_encode_decode();
- nerrors -= test_create_and_close();
- nerrors -= test_basic_dataset_write();
- nerrors -= test_chunked_dataset_write();
- nerrors -= test_on_disk_zoo();
- nerrors -= test_vanishing_datasets();
- nerrors -= test_concurrent_access();
+ nerrors -= test_create_and_close(&opts);
+ nerrors -= test_basic_dataset_write(&opts);
+ nerrors -= test_chunked_dataset_write(&opts);
+ nerrors -= test_on_disk_zoo(&opts);
+ nerrors -= test_vanishing_datasets(&opts);
+ nerrors -= test_concurrent_access(&opts);
}
if (nerrors) {
diff --git a/test/ntypes.c b/test/ntypes.c
index 4d1ec51..e63211f 100644
--- a/test/ntypes.c
+++ b/test/ntypes.c
@@ -26,10 +26,6 @@ const char *FILENAME[] = {"ntypes", NULL};
#define DIM1 200
#define DIM3 20
-int ipoints2[DIM0][DIM1], icheck2[DIM0][DIM1];
-short spoints2[DIM0][DIM1], scheck2[DIM0][DIM1];
-int ipoints3[DIM0][DIM1][5], icheck3[DIM0][DIM1][5];
-
#define DSET_ATOMIC_NAME_1 "atomic_type_1"
#define DSET_ATOMIC_NAME_2 "atomic_type_2"
#define DSET_ATOMIC_NAME_3 "atomic_type_3"
@@ -80,13 +76,24 @@ test_atomic_dtype(hid_t file)
int i, j, n;
hsize_t dims[2];
void * tmp = NULL;
+ struct {
+ int arr[DIM0][DIM1];
+ } *ipoints2 = NULL;
+ struct {
+ int arr[DIM0][DIM1];
+ } *icheck2 = NULL;
TESTING("atomic datatype");
+ if (NULL == (ipoints2 = HDcalloc(1, sizeof(*ipoints2))))
+ TEST_ERROR;
+ if (NULL == (icheck2 = HDcalloc(1, sizeof(*icheck2))))
+ TEST_ERROR;
+
/* Initialize the dataset */
for (i = n = 0; i < DIM0; i++)
for (j = 0; j < DIM1; j++)
- ipoints2[i][j] = n++;
+ ipoints2->arr[i][j] = n++;
/* Create the data space */
dims[0] = DIM0;
@@ -129,7 +136,7 @@ test_atomic_dtype(hid_t file)
/* Read the dataset back. The temporary buffer is for special platforms
* like Cray. */
if (NULL == (tmp = HDmalloc((size_t)(DIM0 * DIM1 * H5Tget_size(native_type)))))
- TEST_ERROR
+ TEST_ERROR;
if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp) < 0)
TEST_ERROR;
@@ -146,7 +153,7 @@ test_atomic_dtype(hid_t file)
/* Check that the values read are the same as the values written */
for (i = 0; i < DIM0; i++)
for (j = 0; j < DIM1; j++)
- if (ipoints2[i][j] != icheck2[i][j]) {
+ if (ipoints2->arr[i][j] != icheck2->arr[i][j]) {
H5_FAILED();
HDprintf(" Read different values than written.\n");
HDprintf(" At index %d,%d\n", i, j);
@@ -270,6 +277,9 @@ test_atomic_dtype(hid_t file)
if (H5Sclose(space) < 0)
TEST_ERROR;
+ HDfree(ipoints2);
+ HDfree(icheck2);
+
PASSED();
return 0;
@@ -287,6 +297,9 @@ error:
}
H5E_END_TRY;
+ HDfree(ipoints2);
+ HDfree(icheck2);
+
return -1;
}
@@ -540,7 +553,7 @@ test_compound_dtype2(hid_t file)
/* Read the dataset back. Temporary buffer is for special platforms like
* Cray */
if (NULL == (tmp = HDmalloc(DIM0 * DIM1 * H5Tget_size(native_type))))
- TEST_ERROR
+ TEST_ERROR;
if (NULL == (bkg = HDcalloc(sizeof(s1), DIM0 * DIM1)))
TEST_ERROR;
@@ -763,9 +776,9 @@ test_compound_dtype(hid_t file)
/* Read the dataset back. Temporary buffer is for special platforms like
* Cray */
if (NULL == (tmp = HDmalloc(DIM0 * DIM1 * H5Tget_size(native_type))))
- TEST_ERROR
+ TEST_ERROR;
if (NULL == (bkg = HDcalloc(sizeof(s1), DIM0 * DIM1)))
- TEST_ERROR
+ TEST_ERROR;
if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp) < 0)
TEST_ERROR;
@@ -1328,13 +1341,24 @@ test_enum_dtype(hid_t file)
short colors[8];
unsigned char sub_colors[16];
const char * mname[] = {"RED", "GREEN", "BLUE", "YELLOW", "PINK", "PURPLE", "ORANGE", "WHITE"};
+ struct {
+ short arr[DIM0][DIM1];
+ } *spoints2 = NULL;
+ struct {
+ short arr[DIM0][DIM1];
+ } *scheck2 = NULL;
TESTING("enum datatype");
+ if (NULL == (spoints2 = HDcalloc(1, sizeof(*spoints2))))
+ TEST_ERROR;
+ if (NULL == (scheck2 = HDcalloc(1, sizeof(*scheck2))))
+ TEST_ERROR;
+
/* Initialize the dataset */
for (i = 0; i < DIM0; i++)
for (j = 0, n = 0; j < DIM1; j++, n++)
- spoints2[i][j] = (short)((i * 10 + j * 100 + n) % 8);
+ spoints2->arr[i][j] = (short)((i * 10 + j * 100 + n) % 8);
/* Create the data space */
dims[0] = DIM0;
@@ -1396,14 +1420,12 @@ test_enum_dtype(hid_t file)
/* Read the dataset back. Temporary buffer is for special platforms like
* Cray */
if (NULL == (tmp = HDmalloc(DIM0 * DIM1 * H5Tget_size(native_type))))
- TEST_ERROR
+ TEST_ERROR;
if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp) < 0)
TEST_ERROR;
HDmemcpy(scheck2, tmp, DIM0 * DIM1 * H5Tget_size(native_type));
- HDfree(tmp);
- tmp = NULL;
if (H5Tconvert(native_type, tid_m, (DIM0 * DIM1), scheck2, NULL, H5P_DEFAULT) < 0)
TEST_ERROR;
@@ -1411,11 +1433,11 @@ test_enum_dtype(hid_t file)
/* Check that the values read are the same as the values written */
for (i = 0; i < DIM0; i++)
for (j = 0; j < DIM1; j++)
- if (spoints2[i][j] != scheck2[i][j]) {
+ if (spoints2->arr[i][j] != scheck2->arr[i][j]) {
H5_FAILED();
HDprintf(" Read different values than written.\n");
HDprintf(" At index %d,%d\n", i, j);
- HDprintf(" spoints2[i][j]=%hd, scheck2[i][j]=%hd\n", spoints2[i][j], scheck2[i][j]);
+ HDprintf(" spoints2[i][j]=%hd, scheck2[i][j]=%hd\n", spoints2->arr[i][j], scheck2->arr[i][j]);
goto error;
} /* end if */
@@ -1423,13 +1445,19 @@ test_enum_dtype(hid_t file)
H5Tclose(dtype);
H5Tclose(native_type);
H5Tclose(tid_m);
+
+ HDfree(tmp);
+ HDfree(spoints2);
+ HDfree(scheck2);
+
PASSED();
return 0;
error:
/* Free memory for test data */
- if (tmp)
- HDfree(tmp);
+ HDfree(tmp);
+ HDfree(spoints2);
+ HDfree(scheck2);
H5E_BEGIN_TRY
{
@@ -1565,7 +1593,7 @@ test_array_dtype(hid_t file)
/* Read the dataset back. Temporary buffer is for special platforms like
* Cray */
if (NULL == (tmp = HDmalloc(DIM0 * DIM1 * H5Tget_size(native_type))))
- TEST_ERROR
+ TEST_ERROR;
if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp) < 0)
TEST_ERROR;
@@ -1657,14 +1685,25 @@ test_array_dtype2(hid_t file)
int i, j, k, n;
hsize_t space_dims[2], array_dims[1] = {5};
void * tmp = NULL;
+ struct {
+ int arr[DIM0][DIM1][5];
+ } *ipoints3 = NULL;
+ struct {
+ int arr[DIM0][DIM1][5];
+ } *icheck3 = NULL;
TESTING("array of atomic datatype");
+ if (NULL == (ipoints3 = HDcalloc(1, sizeof(*ipoints3))))
+ goto error;
+ if (NULL == (icheck3 = HDcalloc(1, sizeof(*icheck3))))
+ goto error;
+
/* Initialize the dataset */
for (i = n = 0; i < DIM0; i++)
for (j = 0; j < DIM1; j++)
for (k = 0; k < 5; k++)
- ipoints3[i][j][k] = n++;
+ ipoints3->arr[i][j][k] = n++;
/* Create the data space */
space_dims[0] = DIM0;
@@ -1713,7 +1752,7 @@ test_array_dtype2(hid_t file)
/* Read the dataset back. Temporary buffer is for special platforms like
* Cray */
if (NULL == (tmp = HDmalloc(DIM0 * DIM1 * H5Tget_size(native_type))))
- TEST_ERROR
+ TEST_ERROR;
if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp) < 0)
TEST_ERROR;
@@ -1729,7 +1768,7 @@ test_array_dtype2(hid_t file)
for (i = 0; i < DIM0; i++)
for (j = 0; j < DIM1; j++)
for (k = 0; k < 5; k++)
- if (icheck3[i][j][k] != ipoints3[i][j][k]) {
+ if (icheck3->arr[i][j][k] != ipoints3->arr[i][j][k]) {
H5_FAILED();
HDprintf(" Read different values than written.\n");
HDprintf(" At index %d,%d\n", i, j);
@@ -1746,6 +1785,9 @@ test_array_dtype2(hid_t file)
if (H5Tclose(tid_m) < 0)
TEST_ERROR;
+ HDfree(ipoints3);
+ HDfree(icheck3);
+
PASSED();
return 0;
@@ -1765,6 +1807,9 @@ error:
}
H5E_END_TRY;
+ HDfree(ipoints3);
+ HDfree(icheck3);
+
return -1;
}
@@ -1830,7 +1875,7 @@ test_vl_dtype(hid_t file)
/* Create a VL datatype for disk storage */
if ((tid = H5Tvlen_create(tid2)) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Create a dataset */
if ((dataset = H5Dcreate2(file, DSET_VL_NAME, tid, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -1898,7 +1943,7 @@ test_vl_dtype(hid_t file)
/* use temporary buffer to convert datatype. This is for special
* platforms like Cray */
if (NULL == (tmp = (void **)HDmalloc(t2->len * sizeof(unsigned int))))
- TEST_ERROR
+ TEST_ERROR;
HDmemcpy(tmp, t2->p, t2->len * H5Tget_size(nat_super_type));
if (H5Tconvert(nat_super_type, H5T_NATIVE_UINT, t2->len, tmp, NULL, H5P_DEFAULT) < 0)
@@ -2276,9 +2321,9 @@ test_refer_dtype(hid_t file)
/* Allocate write & read buffers */
if (NULL == (wbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)))))
- TEST_ERROR
+ TEST_ERROR;
if (NULL == (rbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)))))
- TEST_ERROR
+ TEST_ERROR;
/* Create dataspace for datasets */
if ((sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL)) < 0)
@@ -2286,7 +2331,7 @@ test_refer_dtype(hid_t file)
/* Create a group */
if ((group = H5Gcreate2(file, "Group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Create a datatype to refer to */
if ((tid1 = H5Tcreate(H5T_COMPOUND, sizeof(s1_t))) < 0)
@@ -2451,9 +2496,9 @@ test_refer_dtype2(hid_t file)
/* Allocate write & read buffers */
if (NULL == (dwbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2)))
- TEST_ERROR
+ TEST_ERROR;
if (NULL == (drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), SPACE2_DIM1 * SPACE2_DIM2)))
- TEST_ERROR
+ TEST_ERROR;
/* Create dataspace for datasets */
if ((sid2 = H5Screate_simple(SPACE2_RANK, dims2, NULL)) < 0)
@@ -2912,8 +2957,7 @@ test_ninteger(void)
hid_t nid1 = -1; /* native datatype */
hid_t nid2 = -1; /* native datatype */
hsize_t dims[1] = {DIM3}; /* dataspace dimensions */
- hsize_t nelmts; /* number of elements in dataset */
- int rank = 1; /* rank of dataset */
+ int rank = 1; /* rank of dataset */
int buf[DIM3];
int chk[DIM3];
int i;
@@ -2929,33 +2973,33 @@ test_ninteger(void)
*/
/* create a file using default properties */
if ((fid1 = H5Fcreate("tstint1.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* create a data space */
if ((sid1 = H5Screate_simple(rank, dims, NULL)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* create dcpl */
if ((dcpl1 = H5Pcreate(H5P_DATASET_CREATE)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* create a dataset */
if ((did1 = H5Dcreate2(fid1, "dset", H5T_NATIVE_INT, sid1, H5P_DEFAULT, dcpl1, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* write */
if (H5Dwrite(did1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* close */
if (H5Sclose(sid1) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Pclose(dcpl1) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Dclose(did1) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Fclose(fid1) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/*-------------------------------------------------------------------------
* step 2: open and create another file copying the data from file1
@@ -2964,81 +3008,78 @@ test_ninteger(void)
/* open */
if ((fid1 = H5Fopen("tstint1.h5", H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* open dataset */
if ((did1 = H5Dopen2(fid1, "dset", H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if ((sid1 = H5Dget_space(did1)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* get dcpl */
if ((dcpl1 = H5Dget_create_plist(did1)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* get file datatype */
if ((tid1 = H5Dget_type(did1)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* get native datatype */
if ((nid1 = H5Tget_native_type(tid1, H5T_DIR_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* get size */
if (H5Tget_size(nid1) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* get rank */
if ((rank = H5Sget_simple_extent_ndims(sid1)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
HDmemset(dims, 0, sizeof dims);
/* get dimension */
if (H5Sget_simple_extent_dims(sid1, dims, NULL) < 0)
- FAIL_STACK_ERROR
- nelmts = 1;
- for (i = 0; i < rank; i++)
- nelmts *= dims[i];
+ FAIL_STACK_ERROR;
/* read */
if (H5Dread(did1, nid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, chk) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* create a file using default properties */
if ((fid2 = H5Fcreate("tstint2.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* create a dataset using the native type */
if ((did2 = H5Dcreate2(fid2, "dset", nid1, sid1, H5P_DEFAULT, dcpl1, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* write */
if (H5Dwrite(did2, nid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, chk) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* get dcpl */
if ((dcpl2 = H5Dget_create_plist(did2)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* get file datatype */
if ((tid2 = H5Dget_type(did2)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* get native datatype */
if ((nid2 = H5Tget_native_type(tid2, H5T_DIR_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* check */
if (H5Tget_precision(nid1) != H5Tget_precision(nid2)) {
HDprintf(" Precision differ.\n");
- TEST_ERROR
+ TEST_ERROR;
} /* end if */
/* compare dataset creation property lists */
if (H5Pequal(dcpl1, dcpl2) <= 0) {
HDprintf(" Property lists differ.\n");
- TEST_ERROR
+ TEST_ERROR;
} /* end if */
/* check */
@@ -3047,32 +3088,32 @@ test_ninteger(void)
H5_FAILED();
HDprintf(" Read different values than written.\n");
HDprintf(" At index %d\n", i);
- TEST_ERROR
+ TEST_ERROR;
} /* end if */
/* close */
if (H5Sclose(sid1) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Pclose(dcpl1) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Pclose(dcpl2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Tclose(tid1) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Tclose(tid2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Tclose(nid1) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Tclose(nid2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Dclose(did1) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Dclose(did2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Fclose(fid1) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Fclose(fid2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
PASSED();
return 0;
diff --git a/test/vfd.c b/test/vfd.c
index df348ba..deebb40 100644
--- a/test/vfd.c
+++ b/test/vfd.c
@@ -140,28 +140,28 @@ test_sec2(void)
/* Check that the VFD feature flags are correct */
if ((driver_id = H5Pget_driver(fapl_id)) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (H5FDdriver_query(driver_id, &driver_flags) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_AGGREGATE_METADATA))
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_ACCUMULATE_METADATA))
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_DATA_SIEVE))
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_AGGREGATE_SMALLDATA))
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_POSIX_COMPAT_HANDLE))
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_SUPPORTS_SWMR_IO))
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_DEFAULT_VFD_COMPATIBLE))
- TEST_ERROR
+ TEST_ERROR;
/* Check for extra flags not accounted for above */
if (driver_flags != (H5FD_FEAT_AGGREGATE_METADATA | H5FD_FEAT_ACCUMULATE_METADATA | H5FD_FEAT_DATA_SIEVE |
H5FD_FEAT_AGGREGATE_SMALLDATA | H5FD_FEAT_POSIX_COMPAT_HANDLE |
H5FD_FEAT_SUPPORTS_SWMR_IO | H5FD_FEAT_DEFAULT_VFD_COMPATIBLE))
- TEST_ERROR
+ TEST_ERROR;
if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
TEST_ERROR;
@@ -186,7 +186,7 @@ test_sec2(void)
if (os_file_handle == NULL)
FAIL_PUTS_ERROR("NULL os-specific vfd/file handle was returned from H5Fget_vfd_handle");
- /* There is no garantee the size of metadata in file is constant.
+ /* There is no guarantee the size of metadata in file is constant.
* Just try to check if it's reasonable.
*
* Currently it should be around 2 KB.
@@ -284,26 +284,26 @@ test_core(void)
* so backing-store related flags will not be returned here.
*/
if ((driver_id = H5Pget_driver(fapl_id)) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (H5FDdriver_query(driver_id, &driver_flags) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_AGGREGATE_METADATA))
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_ACCUMULATE_METADATA))
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_DATA_SIEVE))
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_AGGREGATE_SMALLDATA))
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_ALLOW_FILE_IMAGE))
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_CAN_USE_FILE_IMAGE_CALLBACKS))
- TEST_ERROR
+ TEST_ERROR;
/* Check for extra flags not accounted for above */
if (driver_flags !=
(H5FD_FEAT_AGGREGATE_METADATA | H5FD_FEAT_ACCUMULATE_METADATA | H5FD_FEAT_DATA_SIEVE |
H5FD_FEAT_AGGREGATE_SMALLDATA | H5FD_FEAT_ALLOW_FILE_IMAGE | H5FD_FEAT_CAN_USE_FILE_IMAGE_CALLBACKS))
- TEST_ERROR
+ TEST_ERROR;
if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
TEST_ERROR;
@@ -352,7 +352,7 @@ test_core(void)
* they are correct.
*/
if (H5Pget_fapl_core(fapl_id_out, &increment, &backing_store) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (increment != (size_t)CORE_INCREMENT)
FAIL_PUTS_ERROR("incorrect increment from file fapl");
if (backing_store != TRUE)
@@ -382,7 +382,7 @@ test_core(void)
if (os_file_handle == NULL)
FAIL_PUTS_ERROR("NULL os-specific vfd/file handle was returned from H5Fget_vfd_handle");
- /* There is no garantee the size of metadata in file is constant.
+ /* There is no guarantee the size of metadata in file is constant.
* Just try to check if it's reasonable.
*
* TODO: Needs justification of why is this is a reasonable size.
@@ -529,7 +529,7 @@ test_core(void)
} /* end if */
/* Check file size API.
- * There is no garantee the size of metadata in file is constant.
+ * There is no guarantee the size of metadata in file is constant.
* Just try to check if it's reasonable.
*
* TODO: Needs justification of why is this is a reasonable size.
@@ -845,7 +845,7 @@ test_family_opens(char *fname, hid_t fa_pl)
}
H5E_END_TRY;
if (file >= 0)
- TEST_ERROR
+ TEST_ERROR;
/* Case 2: reopen file with correct name template but default property list */
H5E_BEGIN_TRY
@@ -854,7 +854,7 @@ test_family_opens(char *fname, hid_t fa_pl)
}
H5E_END_TRY;
if (file >= 0)
- TEST_ERROR
+ TEST_ERROR;
/* Case 3: reopen file with wrong member size */
if (H5Pset_fapl_family(fa_pl, (hsize_t)128, H5P_DEFAULT) < 0)
@@ -866,7 +866,7 @@ test_family_opens(char *fname, hid_t fa_pl)
}
H5E_END_TRY;
if (file >= 0)
- TEST_ERROR
+ TEST_ERROR;
/* Case 4: reopen file with wrong name template */
HDstrcpy(wrong_name, fname);
@@ -885,7 +885,7 @@ test_family_opens(char *fname, hid_t fa_pl)
}
H5E_END_TRY;
if (file >= 0)
- TEST_ERROR
+ TEST_ERROR;
return 0;
@@ -941,21 +941,21 @@ test_family(void)
/* Check that the VFD feature flags are correct */
if ((driver_id = H5Pget_driver(fapl)) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (H5FDdriver_query(driver_id, &driver_flags) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_AGGREGATE_METADATA))
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_ACCUMULATE_METADATA))
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_DATA_SIEVE))
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_AGGREGATE_SMALLDATA))
- TEST_ERROR
+ TEST_ERROR;
/* Check for extra flags not accounted for above */
if (driver_flags != (H5FD_FEAT_AGGREGATE_METADATA | H5FD_FEAT_ACCUMULATE_METADATA | H5FD_FEAT_DATA_SIEVE |
H5FD_FEAT_AGGREGATE_SMALLDATA))
- TEST_ERROR
+ TEST_ERROR;
if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR;
@@ -1101,7 +1101,7 @@ error:
* See if we can open files created with v1.6 library.
* The source file was created by the test/file_handle.c
* of the v1.6 library. Then tools/misc/h5repart.c was
- * used to concantenated. The command was "h5repart -m 5k
+ * used to concatenated. The command was "h5repart -m 5k
* family_file%05d.h5 family_v16_%05d.h5".
*
* Return: Success: 0
@@ -1369,7 +1369,7 @@ H5_GCC_DIAG_ON("format-nonliteral")
/*-------------------------------------------------------------------------
* Function: test_multi
*
- * Purpose: Tests the file handle interface for MUTLI driver
+ * Purpose: Tests the file handle interface for MULTI driver
*
* Return: SUCCEED/FAIL
*
@@ -1452,21 +1452,21 @@ test_multi(void)
/* Check that the VFD feature flags are correct */
if ((driver_id = H5Pget_driver(fapl)) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (H5FDdriver_query(driver_id, &driver_flags) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_DATA_SIEVE))
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_AGGREGATE_SMALLDATA))
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_USE_ALLOC_SIZE))
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_PAGED_AGGR))
- TEST_ERROR
+ TEST_ERROR;
/* Check for extra flags not accounted for above */
if (driver_flags != (H5FD_FEAT_DATA_SIEVE | H5FD_FEAT_AGGREGATE_SMALLDATA | H5FD_FEAT_USE_ALLOC_SIZE |
H5FD_FEAT_PAGED_AGGR))
- TEST_ERROR
+ TEST_ERROR;
if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR;
@@ -1553,7 +1553,7 @@ test_multi(void)
/* Create and write attribute for the root group. */
if ((root = H5Gopen2(file, "/", H5P_DEFAULT)) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Attribute string. */
if ((atype = H5Tcopy(H5T_C_S1)) < 0)
@@ -1858,28 +1858,28 @@ test_log(void)
/* Check that the VFD feature flags are correct */
if ((driver_id = H5Pget_driver(fapl)) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (H5FDdriver_query(driver_id, &driver_flags) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_AGGREGATE_METADATA))
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_ACCUMULATE_METADATA))
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_DATA_SIEVE))
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_AGGREGATE_SMALLDATA))
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_POSIX_COMPAT_HANDLE))
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_SUPPORTS_SWMR_IO))
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_DEFAULT_VFD_COMPATIBLE))
- TEST_ERROR
+ TEST_ERROR;
/* Check for extra flags not accounted for above */
if (driver_flags != (H5FD_FEAT_AGGREGATE_METADATA | H5FD_FEAT_ACCUMULATE_METADATA | H5FD_FEAT_DATA_SIEVE |
H5FD_FEAT_AGGREGATE_SMALLDATA | H5FD_FEAT_POSIX_COMPAT_HANDLE |
H5FD_FEAT_SUPPORTS_SWMR_IO | H5FD_FEAT_DEFAULT_VFD_COMPATIBLE))
- TEST_ERROR
+ TEST_ERROR;
/* Create the test file */
if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
@@ -1971,23 +1971,23 @@ test_stdio(void)
/* Check that the VFD feature flags are correct */
if ((driver_id = H5Pget_driver(fapl)) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (H5FDdriver_query(driver_id, &driver_flags) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_AGGREGATE_METADATA))
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_ACCUMULATE_METADATA))
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_DATA_SIEVE))
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_AGGREGATE_SMALLDATA))
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_DEFAULT_VFD_COMPATIBLE))
- TEST_ERROR
+ TEST_ERROR;
/* Check for extra flags not accounted for above */
if (driver_flags != (H5FD_FEAT_AGGREGATE_METADATA | H5FD_FEAT_ACCUMULATE_METADATA | H5FD_FEAT_DATA_SIEVE |
H5FD_FEAT_AGGREGATE_SMALLDATA | H5FD_FEAT_DEFAULT_VFD_COMPATIBLE))
- TEST_ERROR
+ TEST_ERROR;
if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR;
@@ -2089,28 +2089,28 @@ test_windows(void)
/* Check that the VFD feature flags are correct */
if ((driver_id = H5Pget_driver(fapl)) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (H5FDdriver_query(driver_id, &driver_flags) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_AGGREGATE_METADATA))
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_ACCUMULATE_METADATA))
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_DATA_SIEVE))
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_AGGREGATE_SMALLDATA))
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_POSIX_COMPAT_HANDLE))
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_SUPPORTS_SWMR_IO))
- TEST_ERROR
+ TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_DEFAULT_VFD_COMPATIBLE))
- TEST_ERROR
+ TEST_ERROR;
/* Check for extra flags not accounted for above */
if (driver_flags != (H5FD_FEAT_AGGREGATE_METADATA | H5FD_FEAT_ACCUMULATE_METADATA | H5FD_FEAT_DATA_SIEVE |
H5FD_FEAT_AGGREGATE_SMALLDATA | H5FD_FEAT_POSIX_COMPAT_HANDLE |
H5FD_FEAT_SUPPORTS_SWMR_IO | H5FD_FEAT_DEFAULT_VFD_COMPATIBLE))
- TEST_ERROR
+ TEST_ERROR;
if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR;
@@ -2191,14 +2191,12 @@ static herr_t
test_ros3(void)
{
#ifdef H5_HAVE_ROS3_VFD
- hid_t fid = -1; /* file ID */
- hid_t fapl_id = -1; /* file access property list ID */
- hid_t fapl_id_out = -1; /* from H5Fget_access_plist */
- hid_t driver_id = -1; /* ID for this VFD */
- unsigned long driver_flags = 0; /* VFD feature flags */
- char filename[1024]; /* filename */
- void * os_file_handle = NULL; /* OS file handle */
- hsize_t file_size; /* file size */
+ hid_t fid = -1; /* file ID */
+ hid_t fapl_id = -1; /* file access property list ID */
+ hid_t fapl_id_out = -1; /* from H5Fget_access_plist */
+ hid_t driver_id = -1; /* ID for this VFD */
+ unsigned long driver_flags = 0; /* VFD feature flags */
+ char filename[1024]; /* filename */
H5FD_ros3_fapl_t test_ros3_fa;
H5FD_ros3_fapl_t ros3_fa_0 = {
/* version = */ H5FD_CURR_ROS3_FAPL_T_VERSION,
@@ -2245,11 +2243,11 @@ test_ros3(void)
TEST_ERROR;
if (!(driver_flags & H5FD_FEAT_DATA_SIEVE))
- TEST_ERROR
+ TEST_ERROR;
/* Check for extra flags not accounted for above */
if (driver_flags != (H5FD_FEAT_DATA_SIEVE))
- TEST_ERROR
+ TEST_ERROR;
PASSED();
return 0;
@@ -2526,7 +2524,7 @@ done:
* Function: driver_is_splitter_compatible
*
* Purpose: Determine whether the driver set in the FAPL ID is compatible
- * with the Splitter VFD -- specificially, Write-Only channel.
+ * with the Splitter VFD -- specifically, Write-Only channel.
*
* Return: Success: 0
* Failure: -1
@@ -2570,7 +2568,7 @@ driver_is_splitter_compatible(hid_t fapl_id)
}
if (H5Pclose(split_fapl_id) < 0) {
- FAIL_PUTS_ERROR("Can't close contained FAPL")
+ FAIL_PUTS_ERROR("Can't close contained FAPL");
}
split_fapl_id = H5I_INVALID_HID;
@@ -3099,7 +3097,7 @@ splitter_tentative_open_test(hid_t child_fapl_id)
SPLITTER_TEST_FAULT("can't close file ID\n");
}
if (!file_exists(filename_rw, child_fapl_id)) {
- SPLITTER_TEST_FAULT("R/W file mysteriously disappared\n");
+ SPLITTER_TEST_FAULT("R/W file mysteriously disappeared\n");
}
if (!file_exists(vfd_config->wo_path, child_fapl_id)) {
SPLITTER_TEST_FAULT("W/O file mysteriously disappeared\n");
@@ -3119,7 +3117,7 @@ splitter_tentative_open_test(hid_t child_fapl_id)
SPLITTER_TEST_FAULT("can't close file ID\n");
}
if (!file_exists(filename_rw, child_fapl_id)) {
- SPLITTER_TEST_FAULT("R/W file mysteriously disappared\n");
+ SPLITTER_TEST_FAULT("R/W file mysteriously disappeared\n");
}
if (!file_exists(vfd_config->wo_path, child_fapl_id)) {
SPLITTER_TEST_FAULT("W/O file mysteriously disappeared\n");
@@ -3150,7 +3148,7 @@ splitter_tentative_open_test(hid_t child_fapl_id)
SPLITTER_TEST_FAULT("can't close file ID\n");
}
if (!file_exists(filename_rw, child_fapl_id)) {
- SPLITTER_TEST_FAULT("R/W file mysteriously disappared\n");
+ SPLITTER_TEST_FAULT("R/W file mysteriously disappeared\n");
}
if (!file_exists(vfd_config->wo_path, child_fapl_id)) {
SPLITTER_TEST_FAULT("W/O file mysteriously disappeared\n");
@@ -3181,7 +3179,7 @@ splitter_tentative_open_test(hid_t child_fapl_id)
SPLITTER_TEST_FAULT("can't close file ID\n");
}
if (!file_exists(filename_rw, child_fapl_id)) {
- SPLITTER_TEST_FAULT("R/W file mysteriously disappared\n");
+ SPLITTER_TEST_FAULT("R/W file mysteriously disappeared\n");
}
if (!file_exists(vfd_config->wo_path, child_fapl_id)) {
SPLITTER_TEST_FAULT("W/O file mysteriously disappeared\n");
@@ -3380,7 +3378,18 @@ error:
int
main(void)
{
- int nerrors = 0;
+ char *env_h5_drvr = NULL;
+ int nerrors = 0;
+
+ /* Don't run VFD tests when HDF5_DRIVER is set. These tests expect a
+ * specific VFD to be set and HDF5_DRIVER being set can interfere
+ * with that.
+ */
+ env_h5_drvr = HDgetenv("HDF5_DRIVER");
+ if (env_h5_drvr) {
+ HDprintf(" -- SKIPPED VFD tests because %s is set -- \n", env_h5_drvr);
+ HDexit(EXIT_SUCCESS);
+ }
h5_reset();