summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSongyu Lu <songyulu@hdfgroup.org>2019-08-14 20:50:56 (GMT)
committerSongyu Lu <songyulu@hdfgroup.org>2019-08-14 20:50:56 (GMT)
commitbb6c72b330560f91271cde0ba4d8620570414733 (patch)
treed6c68f22033f455f92d12e83f7710e7f1290d9c4 /test
parenta09ce0450f3480b7dc9be08c779e72ffb0759aa2 (diff)
parent3b003bf3515b5eccf2995811f88a82aaf7639e64 (diff)
downloadhdf5-bb6c72b330560f91271cde0ba4d8620570414733.zip
hdf5-bb6c72b330560f91271cde0ba4d8620570414733.tar.gz
hdf5-bb6c72b330560f91271cde0ba4d8620570414733.tar.bz2
Merge branch 'hdf5_1_10' of https://bitbucket.hdfgroup.org/scm/~songyulu/hdf5_ray into bugfix/directory_name
Diffstat (limited to 'test')
-rw-r--r--test/CMakeTests.cmake40
-rw-r--r--test/big.c9
-rw-r--r--test/cache_image.c7
-rw-r--r--test/err_compat.c196
-rw-r--r--test/error_test.c9
-rw-r--r--test/external.c2
-rw-r--r--test/external_common.c4
-rw-r--r--test/external_common.h1
-rw-r--r--test/external_env.c33
-rw-r--r--test/fheap.c84
-rw-r--r--test/file_image.c9
-rw-r--r--test/gheap.c324
-rw-r--r--test/h5test.c52
-rw-r--r--test/h5test.h2
-rw-r--r--test/mf.c58
-rw-r--r--test/swmr.c168
-rw-r--r--test/tattr.c352
-rw-r--r--test/tgenprop.c4
-rw-r--r--test/th5s.c64
-rw-r--r--test/titerate.c3
-rw-r--r--test/trefer.c14
-rw-r--r--test/tselect.c676
-rw-r--r--test/tsohm.c260
-rw-r--r--test/tunicode.c2
-rw-r--r--test/vds_env.c20
25 files changed, 1294 insertions, 1099 deletions
diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake
index dd977ce..ef4bcd3 100644
--- a/test/CMakeTests.cmake
+++ b/test/CMakeTests.cmake
@@ -775,15 +775,43 @@ if (HDF5_ENABLE_DEPRECATED_SYMBOLS AND NOT MINGW)
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
+else ()
+ add_test (NAME H5TEST-err_compat COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:err_compat>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_MASK_ERROR=true"
+ -D "ERROR_APPEND=1"
+ -D "TEST_OUTPUT=err_compat.txt"
+ -D "TEST_REFERENCE=err_compat_2"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ set_tests_properties (H5TEST-err_compat PROPERTIES
+ ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
+ )
endif ()
#-- Adding test for error_test
-if (HDF5_USE_16_API_DEFAULT OR MINGW)
- add_test (
- NAME H5TEST-error_test
- COMMAND ${CMAKE_COMMAND} -E echo "SKIP $<TARGET_FILE:error_test>"
+if (DEFAULT_API_VERSION MATCHES "v16" OR MINGW)
+ add_test (NAME H5TEST-error_test COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:error_test>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_MASK_ERROR=true"
+ -D "ERROR_APPEND=1"
+ -D "TEST_OUTPUT=error_test.txt"
+ -D "TEST_REFERENCE=error_test_2"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ set_tests_properties (H5TEST-error_test PROPERTIES
+ ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5_PLUGIN_PRELOAD=::"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
- set_property(TEST H5TEST-error_test PROPERTY DISABLED)
else ()
add_test (NAME H5TEST-error_test COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
@@ -878,10 +906,12 @@ if (BUILD_SHARED_LIBS)
##############################################################################
endif ()
+option (TEST_SHELL_SCRIPTS "Enable shell script tests" OFF)
if (TEST_SHELL_SCRIPTS)
include (ShellTests.cmake)
endif()
+option (ENABLE_EXTENDED_TESTS "Enable extended tests" OFF)
if (ENABLE_EXTENDED_TESTS)
##############################################################################
### S W M R T E S T S
diff --git a/test/big.c b/test/big.c
index b3105eb..46acc5e 100644
--- a/test/big.c
+++ b/test/big.c
@@ -275,6 +275,14 @@ error:
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * 'name' in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
static int
enough_room(hid_t fapl)
{
@@ -315,6 +323,7 @@ done:
return ret_value;
}
+#pragma GCC diagnostic pop
/*-------------------------------------------------------------------------
diff --git a/test/cache_image.c b/test/cache_image.c
index 5967ecc..3725787 100644
--- a/test/cache_image.c
+++ b/test/cache_image.c
@@ -3658,8 +3658,7 @@ cache_image_smoke_check_2(void)
if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
/* 4) Open the file.
*
* Verify that the metadata cache is instructed to load the
@@ -4565,7 +4564,6 @@ cache_image_smoke_check_4(void)
FUNC, failure_mssg);
return !pass;
-
} /* cache_image_smoke_check_4() */
@@ -5028,8 +5026,7 @@ cache_image_smoke_check_5(void)
*/
i = min_group;
while ( ( pass ) && ( i <= max_group ) ) {
-
- sprintf(process_group_name, "/process_%d", i);
+ sprintf(process_group_name, "/process_%d", i);
validate_zoo(file_id, process_group_name, i++);
}
diff --git a/test/err_compat.c b/test/err_compat.c
index 4860a3c..ed85524 100644
--- a/test/err_compat.c
+++ b/test/err_compat.c
@@ -12,17 +12,17 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* October 14, 2001
*
- * Purpose: Tests Error API
+ * Purpose: Tests Error API
*/
#include "h5test.h"
#ifdef H5_NO_DEPRECATED_SYMBOLS
int main(void)
{
- printf("Test skipped because backward compatability with v1.6 is NOT configured in\n");
+ printf("Test skipped because backward compatibility with v1.6 is NOT configured in\n");
return 0;
}
#else /* H5_NO_DEPRECATED_SYMBOLS */
@@ -35,7 +35,7 @@ const char *FILENAME[] = {
#define DIM0 100
#define DIM1 200
-int ipoints2[DIM0][DIM1], icheck2[DIM0][DIM1];
+int ipoints2[DIM0][DIM1], icheck2[DIM0][DIM1];
#define DSET_NAME "a_dataset"
#define FAKE_ID (hid_t)-1
@@ -43,17 +43,17 @@ int ipoints2[DIM0][DIM1], icheck2[DIM0][DIM1];
herr_t custom_print_cb1(int n, H5E_error1_t *err_desc, void* client_data);
herr_t custom_print_cb2(int n, H5E_error2_t *err_desc, void* client_data);
-
+
/*-------------------------------------------------------------------------
- * Function: user_print1
+ * Function: user_print1
*
- * Purpose: This function is a user-defined old-style printing function.
- * This is just a convenience function for H5Ewalk1() with a
+ * Purpose: This function is a user-defined old-style printing function.
+ * This is just a convenience function for H5Ewalk1() with a
* function that prints error messages.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* 4 October 2010
*
*-------------------------------------------------------------------------
@@ -73,17 +73,17 @@ user_print1(FILE *stream)
}
-
+
/*-------------------------------------------------------------------------
- * Function: user_print2
+ * Function: user_print2
*
- * Purpose: This function is a user-defined new-style printing function.
- * This is just a convenience function for H5Ewalk2() with a
+ * Purpose: This function is a user-defined new-style printing function.
+ * This is just a convenience function for H5Ewalk2() with a
* function that prints error messages.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* 4 October 2010
*
*-------------------------------------------------------------------------
@@ -103,18 +103,18 @@ user_print2(hid_t err_stack, FILE *stream)
}
-
+
/*-------------------------------------------------------------------------
* Function: custom_print_cb1
*
- * Purpose: Callback function to print error stack in customized way
+ * Purpose: Callback function to print error stack in customized way
* for H5Ewalk1.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* 4 October 2010
*
* Modifications:
@@ -124,10 +124,10 @@ user_print2(hid_t err_stack, FILE *stream)
herr_t
custom_print_cb1(int n, H5E_error1_t *err_desc, void* client_data)
{
- FILE *stream = (FILE *)client_data;
+ FILE *stream = (FILE *)client_data;
char *maj = NULL;
char *min = NULL;
- const int indent = 4;
+ const int indent = 4;
if(NULL == (min = H5Eget_minor(err_desc->min_num)))
TEST_ERROR;
@@ -136,9 +136,9 @@ custom_print_cb1(int n, H5E_error1_t *err_desc, void* client_data)
TEST_ERROR;
fprintf(stream, "%*serror #%03d: %s in %s(): line %u\n",
- indent, "", n, err_desc->file_name,
- err_desc->func_name, err_desc->line);
-
+ indent, "", n, err_desc->file_name,
+ err_desc->func_name, err_desc->line);
+
fprintf(stream, "%*smajor: %s\n", indent * 2, "", maj);
fprintf(stream, "%*sminor: %s\n", indent * 2, "", min);
@@ -152,22 +152,22 @@ error:
H5free_memory(maj);
if(min)
H5free_memory(min);
-
+
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: custom_print_cb2
*
- * Purpose: Callback function to print error stack in customized way
+ * Purpose: Callback function to print error stack in customized way
* for H5Ewalk1.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* 4 October 2010
*
* Modifications:
@@ -177,10 +177,10 @@ error:
herr_t
custom_print_cb2(int n, H5E_error2_t *err_desc, void* client_data)
{
- FILE *stream = (FILE *)client_data;
+ FILE *stream = (FILE *)client_data;
char *maj = NULL;
char *min = NULL;
- const int indent = 4;
+ const int indent = 4;
if(NULL == (min = H5Eget_minor(err_desc->min_num)))
TEST_ERROR;
@@ -189,9 +189,9 @@ custom_print_cb2(int n, H5E_error2_t *err_desc, void* client_data)
TEST_ERROR;
fprintf(stream, "%*serror #%03d: %s in %s(): line %u\n",
- indent, "", n, err_desc->file_name,
- err_desc->func_name, err_desc->line);
-
+ indent, "", n, err_desc->file_name,
+ err_desc->func_name, err_desc->line);
+
fprintf(stream, "%*smajor: %s\n", indent * 2, "", maj);
fprintf(stream, "%*sminor: %s\n", indent * 2, "", min);
@@ -205,22 +205,22 @@ error:
H5free_memory(maj);
if(min)
H5free_memory(min);
-
+
return -1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_error1
+ * Function: test_error1
*
- * Purpose: Test the backward compatibility of H5Eset/get_auto.
+ * Purpose: Test the backward compatibility of H5Eset/get_auto.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * 17 September 2010
+ * Programmer: Raymond Lu
+ * 17 September 2010
*
*
* Modifications:
@@ -230,8 +230,8 @@ error:
static herr_t
test_error1(void)
{
- hid_t dataset, space;
- hsize_t dims[2];
+ hid_t dataset, space;
+ hsize_t dims[2];
H5E_auto1_t old_func1;
H5E_auto2_t old_func2;
void *old_data;
@@ -245,48 +245,48 @@ test_error1(void)
dims[1] = DIM1;
if ((space = H5Screate_simple(2, dims, NULL))<0) TEST_ERROR;
- /* Use H5Eget_auto2 to query the default printing function. The library
+ /* Use H5Eget_auto2 to query the default printing function. The library
*should indicate H5Eprint2 as the default. */
if (H5Eget_auto2(H5E_DEFAULT, &old_func2, &old_data)<0)
- TEST_ERROR;
+ TEST_ERROR;
if (old_data != NULL)
- TEST_ERROR;
+ TEST_ERROR;
if (!old_func2 || (H5E_auto2_t)H5Eprint2 != old_func2)
- TEST_ERROR;
+ TEST_ERROR;
/* This function sets the default printing function to be H5Eprint2. */
if(H5Eset_auto2(H5E_DEFAULT, old_func2, old_data)<0)
TEST_ERROR;
- /* Try the printing function. Dataset creation should fail because the file
+ /* Try the printing function. Dataset creation should fail because the file
* doesn't exist. */
- dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT,
+ dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT,
H5P_DEFAULT, H5P_DEFAULT);
- if(dataset >= 0)
+ if(dataset >= 0)
TEST_ERROR;
/* This call should work. It simply returns H5Eprint1. */
if((ret = H5Eget_auto1(&old_func1, &old_data))<0)
TEST_ERROR;
if (old_data != NULL)
- TEST_ERROR;
+ TEST_ERROR;
if (!old_func1 || (H5E_auto1_t)H5Eprint1 != old_func1)
- TEST_ERROR;
+ TEST_ERROR;
/* This function changes the old-style printing function to be user_print1. */
if(H5Eset_auto1((H5E_auto1_t)user_print1, stderr)<0)
TEST_ERROR;
- /* Try the printing function. Dataset creation should fail because the file
+ /* Try the printing function. Dataset creation should fail because the file
* doesn't exist. */
- dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT,
+ dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT,
H5P_DEFAULT, H5P_DEFAULT);
- if(dataset >= 0)
+ if(dataset >= 0)
TEST_ERROR;
- /* This call should fail because the test mixes H5Eget_auto2 with H5Eset_auto1.
- * Once the H5Eset_auto1 is called with a user-defined printing function,
- * a call to H5Eget_auto2 will fail. But keep in mind the printing function is
+ /* This call should fail because the test mixes H5Eget_auto2 with H5Eset_auto1.
+ * Once the H5Eset_auto1 is called with a user-defined printing function,
+ * a call to H5Eget_auto2 will fail. But keep in mind the printing function is
* user_print1. */
if((ret = H5Eget_auto2(H5E_DEFAULT, &old_func2, &old_data))>=0)
TEST_ERROR;
@@ -295,44 +295,44 @@ test_error1(void)
if(H5Eset_auto2(H5E_DEFAULT, (H5E_auto2_t)user_print2, stderr)<0)
TEST_ERROR;
- /* Try the printing function. Dataset creation should fail because the file
+ /* Try the printing function. Dataset creation should fail because the file
* doesn't exist. */
- dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT,
+ dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT,
H5P_DEFAULT, H5P_DEFAULT);
- if(dataset >= 0)
+ if(dataset >= 0)
TEST_ERROR;
/* This function changes the new-style printing function back to the default H5Eprint2. */
if(H5Eset_auto2(H5E_DEFAULT, (H5E_auto2_t)H5Eprint2, NULL)<0)
TEST_ERROR;
- /* This call should work because the H5Eset_auto2 above restored the default printing
+ /* This call should work because the H5Eset_auto2 above restored the default printing
* function H5Eprint2. It simply returns user_print1. */
if((ret = H5Eget_auto1(&old_func1, &old_data))<0)
TEST_ERROR;
if (old_data != NULL)
- TEST_ERROR;
+ TEST_ERROR;
if (!old_func1 || (H5E_auto1_t)user_print1 != old_func1)
- TEST_ERROR;
+ TEST_ERROR;
/* This function changes the new-style printing function back to the default H5Eprint1. */
if(H5Eset_auto1((H5E_auto1_t)H5Eprint1, NULL)<0)
TEST_ERROR;
- /* This call should work because the H5Eset_auto1 above restored the default printing
+ /* This call should work because the H5Eset_auto1 above restored the default printing
* function H5Eprint1. It simply returns H5Eprint2. */
if((ret = H5Eget_auto2(H5E_DEFAULT, &old_func2, &old_data))<0)
TEST_ERROR;
if (old_data != NULL)
- TEST_ERROR;
+ TEST_ERROR;
if (!old_func2 || (H5E_auto2_t)H5Eprint2 != old_func2)
- TEST_ERROR;
+ TEST_ERROR;
- /* Try the printing function. Dataset creation should fail because the file
+ /* Try the printing function. Dataset creation should fail because the file
* doesn't exist. */
- dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT,
+ dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT,
H5P_DEFAULT, H5P_DEFAULT);
- if(dataset >= 0)
+ if(dataset >= 0)
TEST_ERROR;
return 0;
@@ -341,18 +341,18 @@ test_error1(void)
return -1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_error2
+ * Function: test_error2
*
- * Purpose: Test error API functions, mainly on H5Epush1.
+ * Purpose: Test error API functions, mainly on H5Epush1.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * July 10, 2003
+ * Programmer: Raymond Lu
+ * July 10, 2003
*
*
* Modifications:
@@ -362,8 +362,8 @@ test_error1(void)
static herr_t
test_error2(hid_t file)
{
- hid_t dataset, space;
- hsize_t dims[2];
+ hid_t dataset, space;
+ hsize_t dims[2];
const char *FUNC_test_error="test_error2";
TESTING("error API based on data I/O");
@@ -381,7 +381,7 @@ test_error2(hid_t file)
/* Create the dataset */
if ((dataset = H5Dcreate2(file, DSET_NAME, H5T_STD_I32BE, space,
- H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
H5Epush1(__FILE__, FUNC_test_error, __LINE__, H5E_ERROR, H5E_CANTCREATE,
"H5Dcreate2 failed");
goto error;
@@ -411,18 +411,18 @@ test_error2(hid_t file)
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: dump_error
*
- * Purpose: Prints error stack in default and customized ways.
+ * Purpose: Prints error stack in default and customized ways.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * July 17, 2003
+ * Programmer: Raymond Lu
+ * July 17, 2003
*
*
* Modifications:
@@ -449,14 +449,14 @@ dump_error(void)
}
-
+
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: Test error API.
+ * Purpose: Test error API.
*
- * Programmer: Raymond Lu
- * July 10, 2003
+ * Programmer: Raymond Lu
+ * July 10, 2003
*
* Modifications:
*
@@ -465,8 +465,8 @@ dump_error(void)
int
main(void)
{
- hid_t file, fapl;
- char filename[1024];
+ hid_t file, fapl;
+ char filename[1024];
const char *FUNC_main="main";
fprintf(stderr, " This program tests the Error API compatible with HDF5 v1.6. There are supposed to be some error messages\n");
@@ -474,7 +474,7 @@ main(void)
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- TEST_ERROR ;
+ TEST_ERROR ;
/* Test error stack */
diff --git a/test/error_test.c b/test/error_test.c
index 580234a..1de9065 100644
--- a/test/error_test.c
+++ b/test/error_test.c
@@ -320,6 +320,14 @@ long_desc_cb(unsigned H5_ATTR_UNUSED n, const H5E_error2_t *err_desc, void *clie
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * 'full_desc' in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
static herr_t
test_long_desc(void)
{
@@ -374,6 +382,7 @@ error:
return -1;
} /* end test_long_desc() */
+#pragma GCC diagnostic pop
/*-------------------------------------------------------------------------
diff --git a/test/external.c b/test/external.c
index 8a4ca86..e63b9da 100644
--- a/test/external.c
+++ b/test/external.c
@@ -1399,6 +1399,6 @@ error:
H5Gclose(gid);
} H5E_END_TRY;
nerrors = MAX(1, nerrors);
- printf("%d TEST%s FAILED.\n", nerrors, 1 == nerrors ? "" : "s");
+ HDprintf("%d TEST%s FAILED.\n", nerrors, 1 == nerrors ? "" : "s");
return EXIT_FAILURE;
} /* end main() */
diff --git a/test/external_common.c b/test/external_common.c
index c9b6584..9e759cd 100644
--- a/test/external_common.c
+++ b/test/external_common.c
@@ -60,7 +60,7 @@ reset_raw_data_files(hbool_t is_env)
/* Open file */
if(is_env)
- HDsprintf(filename, "extern_env_%lur.raw", (unsigned long)i + 1);
+ HDsprintf(filename, "extern_env_dir%sextern_env_%lur.raw", H5_DIR_SEPS, (unsigned long)i + 1);
else
HDsprintf(filename, "extern_%lur.raw", (unsigned long)i + 1);
if((fd = HDopen(filename, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0)
@@ -97,7 +97,7 @@ reset_raw_data_files(hbool_t is_env)
/* Open file */
if(is_env)
- HDsprintf(filename, "extern_env_%luw.raw", (unsigned long)i + 1);
+ HDsprintf(filename, "extern_env_dir%sextern_env_%luw.raw", H5_DIR_SEPS, (unsigned long)i + 1);
else
HDsprintf(filename, "extern_%luw.raw", (unsigned long)i + 1);
if((fd = HDopen(filename, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0)
diff --git a/test/external_common.h b/test/external_common.h
index 043f36b..937b7d0 100644
--- a/test/external_common.h
+++ b/test/external_common.h
@@ -30,7 +30,6 @@ static const char *EXT_FNAME[] = {
"extern_4",
"extern_dir/file_1",
"extern_5",
- "extern_env_dir/file_2",
NULL
};
diff --git a/test/external_env.c b/test/external_env.c
index fca5458..484b3ea4 100644
--- a/test/external_env.c
+++ b/test/external_env.c
@@ -16,6 +16,11 @@
*/
#include "external_common.h"
+const static char *EXT_ENV_FNAME[] = {
+ "extern_env_dir/file_2",
+ NULL
+};
+
/*-------------------------------------------------------------------------
* Function: test_path_env
@@ -56,10 +61,8 @@ test_path_env(hid_t fapl)
TESTING("prefix in HDF5_EXTFILE_PREFIX");
- if(HDmkdir("extern_env_dir", (mode_t)0755) < 0 && errno != EEXIST)
- TEST_ERROR;
+ h5_fixname(EXT_ENV_FNAME[0], fapl, filename, sizeof(filename));
- h5_fixname(EXT_FNAME[6], fapl, filename, sizeof(filename));
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
FAIL_STACK_ERROR
@@ -73,7 +76,7 @@ test_path_env(hid_t fapl)
if(NULL == HDgetcwd(cwdpath, sizeof(cwdpath)))
TEST_ERROR
for(i = 0; i < N_EXT_FILES; i++) {
- HDsnprintf(filename, sizeof(filename), "..%sextern_env_%dr.raw", H5_DIR_SEPS, (int) i + 1);
+ HDsnprintf(filename, sizeof(filename), "extern_env_%dr.raw", (int) i + 1);
if(H5Pset_external(dcpl, filename, (off_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -158,6 +161,9 @@ main(void)
if(H5Pset_libver_bounds(fapl_id_new, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
FAIL_STACK_ERROR
+ if(HDmkdir("extern_env_dir", (mode_t)0755) < 0 && errno != EEXIST)
+ TEST_ERROR;
+
/* Test with old & new format groups */
for(latest_format = FALSE; latest_format <= TRUE; latest_format++) {
hid_t current_fapl_id = -1;
@@ -183,16 +189,16 @@ main(void)
HDputs("All external storage tests passed.");
/* Clean up files used by file set tests */
- if(h5_cleanup(EXT_FNAME, fapl_id_old)) {
- HDremove("extern_env_1r.raw");
- HDremove("extern_env_2r.raw");
- HDremove("extern_env_3r.raw");
- HDremove("extern_env_4r.raw");
+ if(h5_cleanup(EXT_ENV_FNAME, fapl_id_old)) {
+ char filename[1024]; /* file name */
+ int i;
- HDremove("extern_env_1w.raw");
- HDremove("extern_env_2w.raw");
- HDremove("extern_env_3w.raw");
- HDremove("extern_env_4w.raw");
+ for(i = 0; i < N_EXT_FILES; i++) {
+ HDsnprintf(filename, sizeof(filename), "extern_env_dir%sextern_env_%dr.raw", H5_DIR_SEPS, i + 1);
+ HDremove(filename);
+ HDsnprintf(filename, sizeof(filename), "extern_env_dir%sextern_env_%dw.raw", H5_DIR_SEPS, i + 1);
+ HDremove(filename);
+ }
HDrmdir("extern_env_dir");
} /* end if */
@@ -206,6 +212,7 @@ error:
H5Pclose(fapl_id_new);
H5Gclose(gid);
} H5E_END_TRY;
+
nerrors = MAX(1, nerrors);
printf("%d TEST%s FAILED.\n", nerrors, 1 == nerrors ? "" : "s");
return EXIT_FAILURE;
diff --git a/test/fheap.c b/test/fheap.c
index e38d263..48261ef 100644
--- a/test/fheap.c
+++ b/test/fheap.c
@@ -539,6 +539,14 @@ get_fill_size(const fheap_test_param_t *tparam)
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * test_desc in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
static int
begin_test(fheap_test_param_t *tparam, const char *base_desc,
fheap_heap_ids_t *keep_ids, size_t *fill_size)
@@ -567,6 +575,7 @@ begin_test(fheap_test_param_t *tparam, const char *base_desc,
/* Success */
return(0);
} /* end begin_test() */
+#pragma GCC diagnostic pop
/*-------------------------------------------------------------------------
@@ -683,6 +692,7 @@ open_heap(char *filename, hid_t fapl, const H5HF_create_t *cparam,
/* Close (empty) heap */
if(H5HF_close(*fh) < 0)
FAIL_STACK_ERROR
+ *fh = NULL;
} /* end if */
/* Close file */
@@ -759,6 +769,7 @@ reopen_heap(H5F_t *f, H5HF_t **fh, haddr_t fh_addr,
/* Close (empty) heap */
if(H5HF_close(*fh) < 0)
FAIL_STACK_ERROR
+ *fh = NULL;
/* Re-open heap */
if(NULL == (*fh = H5HF_open(f, fh_addr)))
@@ -766,10 +777,10 @@ reopen_heap(H5F_t *f, H5HF_t **fh, haddr_t fh_addr,
} /* end if */
/* Success */
- return(0);
+ return 0;
error:
- return(-1);
+ return -1;
} /* end reopen_heap() */
@@ -1906,6 +1917,7 @@ test_create(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
/* Close the fractal heap */
if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
+ fh = NULL;
/* Delete heap */
if(H5HF_delete(f, fh_addr) < 0)
@@ -1926,15 +1938,15 @@ test_create(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
/* All tests passed */
PASSED()
- return(0);
+ return 0;
error:
H5E_BEGIN_TRY {
if(fh)
H5HF_close(fh);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
- return(1);
+ return 1;
} /* test_create() */
@@ -2020,6 +2032,7 @@ test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
/* Close the fractal heap */
if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
+ fh = NULL;
/* Check for closing & re-opening the file */
if(tparam->reopen_heap) {
@@ -2083,7 +2096,7 @@ error:
H5E_BEGIN_TRY {
if(fh)
H5HF_close(fh);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_reopen() */
@@ -2250,7 +2263,7 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
/* All tests passed */
PASSED()
- return(0);
+ return 0;
error:
H5E_BEGIN_TRY {
@@ -2258,11 +2271,11 @@ error:
H5HF_close(fh);
if(fh2)
H5HF_close(fh2);
- H5Fclose(file);
- H5Fclose(file2);
+ H5Fclose(file);
+ H5Fclose(file2);
} H5E_END_TRY;
- return(1);
+ return 1;
} /* test_open_twice() */
@@ -2366,6 +2379,7 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
if(fh2) {
/* Close opened heap */
H5HF_close(fh2);
+ fh2 = NULL;
/* Indicate error */
TEST_ERROR
@@ -2403,6 +2417,7 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
if(fh) {
/* Close opened heap */
H5HF_close(fh);
+ fh = NULL;
/* Indicate error */
TEST_ERROR
@@ -2423,7 +2438,7 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
/* All tests passed */
PASSED()
- return(0);
+ return 0;
error:
H5E_BEGIN_TRY {
@@ -2431,9 +2446,9 @@ error:
H5HF_close(fh);
if(fh2)
H5HF_close(fh2);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
- return(1);
+ return 1;
} /* test_delete_open() */
@@ -2769,15 +2784,15 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
/* All tests passed */
PASSED()
- return(0);
+ return 0;
error:
H5E_BEGIN_TRY {
if(fh)
H5HF_close(fh);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
- return(1);
+ return 1;
} /* test_id_limits() */
@@ -2878,6 +2893,7 @@ test_filtered_create(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
/* Close the fractal heap */
if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
+ fh = NULL;
/* Close the file */
@@ -2891,15 +2907,15 @@ test_filtered_create(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
/* All tests passed */
PASSED()
- return(0);
+ return 0;
error:
H5E_BEGIN_TRY {
if(fh)
H5HF_close(fh);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
- return(1);
+ return 1;
} /* test_filtered_create() */
@@ -3022,7 +3038,7 @@ test_size(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
/* Close the fractal heap */
if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
-
+ fh = NULL;
/* Close the file */
if(H5Fclose(file) < 0)
@@ -3031,15 +3047,15 @@ test_size(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
/* All tests passed */
PASSED()
- return(0);
+ return 0;
error:
H5E_BEGIN_TRY {
if(fh)
H5HF_close(fh);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
- return(1);
+ return 1;
} /* test_size() */
@@ -6645,6 +6661,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
/* Close the fractal heap */
if(H5HF_close(fh) < 0)
TEST_ERROR
+ fh = NULL;
/* Close the file */
if(H5Fclose(file) < 0)
@@ -6836,6 +6853,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
/* Close the fractal heap */
if(H5HF_close(fh) < 0)
TEST_ERROR
+ fh = NULL;
/* Close the file */
if(H5Fclose(file) < 0)
@@ -7003,6 +7021,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
/* Close the fractal heap */
if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
+ fh = NULL;
/* Close the file */
if(H5Fclose(file) < 0)
@@ -7241,6 +7260,7 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
/* Close the fractal heap */
if(H5HF_close(fh) < 0)
TEST_ERROR
+ fh = NULL;
/* Close the file */
if(H5Fclose(file) < 0)
@@ -7543,6 +7563,7 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
/* Close the fractal heap */
if(H5HF_close(fh) < 0)
TEST_ERROR
+ fh = NULL;
/* Close the file */
if(H5Fclose(file) < 0)
@@ -7599,7 +7620,7 @@ test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_
unsigned char heap_id[100][MAX_HEAP_ID_LEN]; /* Heap ID for object inserted */
struct a_type_t1 {
char a[10];
- char b[29];
+ char b[40];
} obj1, obj2; /* Objects to insert/remove */
size_t id_len; /* Size of fractal heap IDs */
fheap_heap_state_t state; /* State of fractal heap */
@@ -7640,14 +7661,14 @@ test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_
*/
TESTING("incremental object insertion and removal")
+ HDmemset(&obj1, 0, sizeof(obj1));
+ HDmemset(&obj2, 0, sizeof(obj2));
for(i = 0; i < 100; i++) {
- HDsprintf(obj1.b, "%s%d", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", i);
-
for(j = 0; j < i; j++) {
- HDsprintf(obj2.b, "%s%d", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", j);
-
if(H5HF_remove(fh, heap_id[j]) < 0)
FAIL_STACK_ERROR
+
+ HDsprintf(obj2.b, "%s%2d", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", j);
if(H5HF_insert(fh, (sizeof(obj2)), &obj2, heap_id[j]) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -7658,6 +7679,7 @@ test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_
/* Insert object */
HDmemset(heap_id[i], 0, id_len);
+ HDsprintf(obj1.b, "%s%2d", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", i);
if(H5HF_insert(fh, (sizeof(obj1)), &obj1, heap_id[i]) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -13685,15 +13707,15 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam
H5HF_create_t tmp_cparam; /* Local heap creation parameters */
fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */
size_t id_len; /* Size of fractal heap IDs */
- h5_stat_size_t empty_size; /* Size of a file with an empty heap */
- h5_stat_size_t file_size; /* Size of file currently */
+ h5_stat_size_t empty_size; /* Size of a file with an empty heap */
+ h5_stat_size_t file_size; /* Size of file currently */
unsigned char *heap_id = NULL; /* Heap ID for object */
size_t obj_size; /* Size of object */
size_t robj_size; /* Size of object read */
unsigned char obj_type; /* Type of storage for object */
fheap_heap_state_t state; /* State of fractal heap */
unsigned deflate_level; /* Deflation level */
- size_t old_actual_id_len =0 ; /* Old actual ID length */
+ size_t old_actual_id_len = 0; /* Old actual ID length */
hbool_t huge_ids_direct; /* Are 'huge' objects directly acccessed? */
const char *base_desc = "insert 'huge' object into heap with I/O filters, then remove %s"; /* Test description */
diff --git a/test/file_image.c b/test/file_image.c
index 12f0a18..3249c83 100644
--- a/test/file_image.c
+++ b/test/file_image.c
@@ -671,6 +671,14 @@ error:
*
******************************************************************************
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * 'member_file_name' in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
static int
test_get_file_image(const char * test_banner,
const int file_name_num,
@@ -937,6 +945,7 @@ test_get_file_image(const char * test_banner,
error:
return 1;
} /* end test_get_file_image() */
+#pragma GCC diagnostic pop
/******************************************************************************
diff --git a/test/gheap.c b/test/gheap.c
index bf0f18a..32e2785 100644
--- a/test/gheap.c
+++ b/test/gheap.c
@@ -15,9 +15,9 @@
* Programmer: Robb Matzke <matzke@llnl.gov>
* Tuesday, March 31, 1998
*
- * Purpose: Tests the global heap. The global heap is the set of all
- * collections but the collections are not related to one
- * another by anything that appears in the file format.
+ * Purpose: Tests the global heap. The global heap is the set of all
+ * collections but the collections are not related to one
+ * another by anything that appears in the file format.
*/
#include "h5test.h"
#include "H5ACprivate.h"
@@ -60,33 +60,31 @@ const char *FILENAME[] = {
/*-------------------------------------------------------------------------
* Function: test_1
*
- * Purpose: Writes a sequence of objects to the global heap where each
- * object is larger than the one before.
+ * Purpose: Writes a sequence of objects to the global heap where each
+ * object is larger than the one before.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
* Programmer: Robb Matzke
* Tuesday, March 31, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
test_1 (hid_t fapl)
{
- hid_t file = -1;
- H5F_t *f = NULL;
- H5HG_t *obj = NULL;
- uint8_t out[GHEAP_TEST_NOBJS];
- uint8_t in[GHEAP_TEST_NOBJS];
- size_t u;
- size_t size;
- herr_t status;
- int nerrors = 0;
- char filename[1024];
+ hid_t file = H5I_INVALID_HID;
+ H5F_t *f = NULL;
+ H5HG_t *obj = NULL;
+ uint8_t out[GHEAP_TEST_NOBJS];
+ uint8_t in[GHEAP_TEST_NOBJS];
+ size_t u;
+ size_t size;
+ herr_t status;
+ int nerrors = 0;
+ char filename[1024];
TESTING("monotonically increasing lengths");
@@ -97,10 +95,10 @@ test_1 (hid_t fapl)
/* Open a clean file */
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- goto error;
+ goto error;
if(NULL == (f = (H5F_t *)H5I_object(file))) {
H5_FAILED();
- puts(" Unable to create file");
+ HDputs(" Unable to create file");
goto error;
}
@@ -116,11 +114,12 @@ test_1 (hid_t fapl)
status = H5HG_insert(f, size, out, obj + u);
if(status < 0) {
H5_FAILED();
- puts(" Unable to insert object into global heap");
+ HDputs(" Unable to insert object into global heap");
nerrors++;
- } else if(u && H5F_addr_gt(obj[u - 1].addr, obj[u].addr)) {
+ }
+ else if(u && H5F_addr_gt(obj[u - 1].addr, obj[u].addr)) {
H5_FAILED();
- puts(" Collection addresses are not monotonically increasing");
+ HDputs(" Collection addresses are not monotonically increasing");
nerrors++;
}
}
@@ -134,11 +133,12 @@ test_1 (hid_t fapl)
H5Eclear2(H5E_DEFAULT);
if(NULL == H5HG_read(f, obj + u, in, NULL)) {
H5_FAILED();
- puts(" Unable to read object");
+ HDputs(" Unable to read object");
nerrors++;
- } else if(HDmemcmp(in, out, size)) {
+ }
+ else if(HDmemcmp(in, out, size)) {
H5_FAILED();
- puts(" Value read doesn't match value written");
+ HDputs(" Value read doesn't match value written");
nerrors++;
}
}
@@ -147,15 +147,17 @@ test_1 (hid_t fapl)
HDfree(obj);
obj = NULL;
- if(H5Fclose(file) < 0) goto error;
- if(nerrors) goto error;
+ if(H5Fclose(file) < 0)
+ goto error;
+ if(nerrors)
+ goto error;
PASSED();
return 0;
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
if(obj)
HDfree(obj);
@@ -166,32 +168,30 @@ error:
/*-------------------------------------------------------------------------
* Function: test_2
*
- * Purpose: Writes a sequence of objects to the global heap where each
- * object is smaller than the one before.
+ * Purpose: Writes a sequence of objects to the global heap where each
+ * object is smaller than the one before.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, March 31, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
test_2 (hid_t fapl)
{
- hid_t file = -1;
- H5F_t *f = NULL;
- H5HG_t *obj = NULL;
- uint8_t out[GHEAP_TEST_NOBJS];
- uint8_t in[GHEAP_TEST_NOBJS];
- size_t u;
- size_t size;
- int nerrors = 0;
- char filename[1024];
+ hid_t file = H5I_INVALID_HID;
+ H5F_t *f = NULL;
+ H5HG_t *obj = NULL;
+ uint8_t out[GHEAP_TEST_NOBJS];
+ uint8_t in[GHEAP_TEST_NOBJS];
+ size_t u;
+ size_t size;
+ int nerrors = 0;
+ char filename[1024];
TESTING("monotonically decreasing lengths");
@@ -202,10 +202,10 @@ test_2 (hid_t fapl)
/* Open a clean file */
h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- goto error;
+ goto error;
if(NULL == (f = (H5F_t *)H5I_object(file))) {
H5_FAILED();
- puts(" Unable to create file");
+ HDputs(" Unable to create file");
goto error;
}
@@ -216,9 +216,9 @@ test_2 (hid_t fapl)
size = GHEAP_TEST_NOBJS - u;
HDmemset(out, (int)('A' + u % 26), size);
H5Eclear2(H5E_DEFAULT);
- if (H5HG_insert (f, size, out, obj + u) < 0) {
+ if(H5HG_insert(f, size, out, obj + u) < 0) {
H5_FAILED();
- puts(" Unable to insert object into global heap");
+ HDputs(" Unable to insert object into global heap");
nerrors++;
}
}
@@ -232,11 +232,12 @@ test_2 (hid_t fapl)
H5Eclear2(H5E_DEFAULT);
if(NULL == H5HG_read(f, obj + u, in, NULL)) {
H5_FAILED();
- puts(" Unable to read object");
+ HDputs(" Unable to read object");
nerrors++;
- } else if (memcmp (in, out, size)) {
+ }
+ else if (memcmp (in, out, size)) {
H5_FAILED();
- puts(" Value read doesn't match value written");
+ HDputs(" Value read doesn't match value written");
nerrors++;
}
}
@@ -245,15 +246,17 @@ test_2 (hid_t fapl)
HDfree(obj);
obj = NULL;
- if (H5Fclose(file)<0) goto error;
- if (nerrors) goto error;
+ if(H5Fclose(file) < 0)
+ goto error;
+ if(nerrors)
+ goto error;
PASSED();
return 0;
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
if(obj)
HDfree(obj);
@@ -264,32 +267,30 @@ test_2 (hid_t fapl)
/*-------------------------------------------------------------------------
* Function: test_3
*
- * Purpose: Creates a few global heap objects and then removes them all.
- * The collection should also be removed.
+ * Purpose: Creates a few global heap objects and then removes them all.
+ * The collection should also be removed.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
* Programmer: Robb Matzke
* Tuesday, March 31, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
test_3 (hid_t fapl)
{
- hid_t file = -1;
- H5F_t *f = NULL;
- H5HG_t *obj = NULL;
- uint8_t out[GHEAP_TEST_NOBJS];
- size_t u;
- size_t size;
- herr_t status;
- int nerrors = 0;
- char filename[1024];
+ hid_t file = H5I_INVALID_HID;
+ H5F_t *f = NULL;
+ H5HG_t *obj = NULL;
+ uint8_t out[GHEAP_TEST_NOBJS];
+ size_t u;
+ size_t size;
+ herr_t status;
+ int nerrors = 0;
+ char filename[1024];
TESTING("complete object removal");
@@ -300,11 +301,11 @@ test_3 (hid_t fapl)
/* Open a clean file */
h5_fixname(FILENAME[2], fapl, filename, sizeof filename);
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- goto error;
+ goto error;
if(NULL == (f = (H5F_t *)H5I_object(file))) {
- H5_FAILED();
- puts(" Unable to create file");
- goto error;
+ H5_FAILED();
+ HDputs(" Unable to create file");
+ goto error;
}
/* Create some stuff */
@@ -315,7 +316,7 @@ test_3 (hid_t fapl)
status = H5HG_insert(f, size, out, obj + u);
if (status<0) {
H5_FAILED();
- puts(" Unable to insert object into global heap");
+ HDputs(" Unable to insert object into global heap");
nerrors++;
}
}
@@ -325,7 +326,7 @@ test_3 (hid_t fapl)
status = H5HG_remove(f, obj + u);
if (status<0) {
H5_FAILED();
- puts(" Unable to remove object");
+ HDputs(" Unable to remove object");
nerrors++;
}
}
@@ -334,15 +335,17 @@ test_3 (hid_t fapl)
HDfree(obj);
obj = NULL;
- if (H5Fclose(file)<0) goto error;
- if (nerrors) goto error;
+ if(H5Fclose(file) < 0)
+ goto error;
+ if(nerrors)
+ goto error;
PASSED();
return 0;
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
if(obj)
HDfree(obj);
@@ -353,33 +356,31 @@ test_3 (hid_t fapl)
/*-------------------------------------------------------------------------
* Function: test_4
*
- * Purpose: Tests the H5HG_remove() feature by writing lots of objects
- * and occassionally removing some. When we're done they're all
- * removed.
+ * Purpose: Tests the H5HG_remove() feature by writing lots of objects
+ * and occassionally removing some. When we're done they're all
+ * removed.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
* Programmer: Robb Matzke
* Tuesday, March 31, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
test_4 (hid_t fapl)
{
- hid_t file = -1;
- H5F_t *f = NULL;
- H5HG_t *obj = NULL;
- uint8_t out[GHEAP_TEST_NOBJS];
- size_t u;
- size_t size;
- herr_t status;
- int nerrors = 0;
- char filename[1024];
+ hid_t file = H5I_INVALID_HID;
+ H5F_t *f = NULL;
+ H5HG_t *obj = NULL;
+ uint8_t out[GHEAP_TEST_NOBJS];
+ size_t u;
+ size_t size;
+ herr_t status;
+ int nerrors = 0;
+ char filename[1024];
TESTING("partial object removal");
@@ -390,10 +391,10 @@ test_4 (hid_t fapl)
/* Open a clean file */
h5_fixname(FILENAME[3], fapl, filename, sizeof filename);
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- goto error;
+ goto error;
if(NULL == (f = (H5F_t *)H5I_object(file))) {
H5_FAILED();
- puts(" Unable to create file");
+ HDputs(" Unable to create file");
goto error;
}
@@ -405,21 +406,20 @@ test_4 (hid_t fapl)
status = H5HG_insert(f, size, out, obj + u);
if (status<0) {
H5_FAILED();
- puts(" Unable to insert object into global heap");
+ HDputs(" Unable to insert object into global heap");
nerrors++;
}
- /*
- * Remove every third one beginning with the second, but after the
- * next one has already been inserted. That is, insert A, B, C;
- * remove B, insert D, E, F; remove E; etc.
- */
+ /* Remove every third one beginning with the second, but after the
+ * next one has already been inserted. That is, insert A, B, C;
+ * remove B, insert D, E, F; remove E; etc.
+ */
if(1 == (u % 3)) {
H5Eclear2(H5E_DEFAULT);
status = H5HG_remove(f, obj + u - 1);
if (status<0) {
H5_FAILED();
- puts(" Unable to remove object");
+ HDputs(" Unable to remove object");
nerrors++;
}
HDmemset(obj + u - 1, 0, sizeof *obj);
@@ -430,15 +430,17 @@ test_4 (hid_t fapl)
HDfree(obj);
obj = NULL;
- if (H5Fclose(file)<0) goto error;
- if (nerrors) goto error;
+ if(H5Fclose(file) < 0)
+ goto error;
+ if(nerrors)
+ goto error;
PASSED();
return 0;
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
if(obj)
HDfree(obj);
@@ -449,32 +451,30 @@ test_4 (hid_t fapl)
/*-------------------------------------------------------------------------
* Function: test_ooo_indices
*
- * Purpose: Tests that indices can be stored out of order. This can
+ * Purpose: Tests that indices can be stored out of order. This can
* happen when the indices "wrap around" due to many
* insertions and deletions (for example, from rewriting a
* VL dataset).
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
* Programmer: Neil Fortner
* Monday, October 26, 2009
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
test_ooo_indices(hid_t fapl)
{
- hid_t file = -1;
- H5F_t *f = NULL;
+ hid_t file = H5I_INVALID_HID;
+ H5F_t *f = NULL;
unsigned i, j;
- H5HG_t *obj = NULL;
- herr_t status;
- int nerrors=0;
- char filename[1024];
+ H5HG_t *obj = NULL;
+ herr_t status;
+ int nerrors = 0;
+ char filename[1024];
TESTING("out of order indices");
@@ -487,16 +487,18 @@ test_ooo_indices(hid_t fapl)
goto error;
if(NULL == (f = (H5F_t *)H5I_object(file))) {
H5_FAILED();
- puts(" Unable to create file");
+ HDputs(" Unable to create file");
goto error;
- } /* end if */
+ }
/* Alternately insert 1000 entries and remove the previous group of 1000
- * entries, until the indices wrap around */
- for(i=0; i<66; i++) {
+ * entries, until the indices wrap around.
+ */
+ for(i = 0; i < 66; i++) {
/* Insert 1000 entries. The index into the obj array will alternate up
* and down by 1000 so the previous set of insertions is preserved and
- * can be deleted. */
+ * can be deleted.
+ */
for(j=1000*((~i&1)); j<1000*((~i&1)+1); j++) {
H5Eclear2(H5E_DEFAULT);
status = H5HG_insert(f, sizeof(j), &j, &obj[j]);
@@ -506,7 +508,7 @@ test_ooo_indices(hid_t fapl)
/* Check that the index is as expected */
if(obj[j].idx != ((1000 * i) + j - (1000 * ((~i & 1)))) % ((1u << 16) - 1) + 1)
GHEAP_REPEATED_ERR(" Unexpected global heap index");
- } /* end for */
+ }
/* Remove the previous 1000 entries */
if(i>0)
@@ -515,20 +517,21 @@ test_ooo_indices(hid_t fapl)
status = H5HG_remove(f, &obj[j]);
if (status<0)
GHEAP_REPEATED_ERR(" Unable to remove object from global heap");
- } /* end for */
- } /* end for */
+ }
+ }
/* The indices should have "wrapped around" on the last iteration */
HDassert(obj[534].idx == 65535);
HDassert(obj[535].idx == 1);
/* Reopen the file */
- if (H5Fclose(file)<0) goto error;
+ if (H5Fclose(file) < 0)
+ goto error;
if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
goto error;
if(NULL == (f = (H5F_t *)H5I_object(file))) {
H5_FAILED();
- puts(" Unable to open file");
+ HDputs(" Unable to open file");
goto error;
} /* end if */
@@ -538,14 +541,15 @@ test_ooo_indices(hid_t fapl)
goto error;
if(i != j) {
H5_FAILED();
- puts(" Incorrect read value");
+ HDputs(" Incorrect read value");
goto error;
- } /* end if */
- } /* end for */
-
- if (H5Fclose(file)<0) goto error;
- if (nerrors) goto error;
+ }
+ }
+ if(H5Fclose(file) < 0)
+ goto error;
+ if(nerrors)
+ goto error;
HDfree(obj);
obj = NULL;
@@ -554,7 +558,7 @@ test_ooo_indices(hid_t fapl)
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
if(obj)
HDfree(obj);
@@ -563,60 +567,58 @@ test_ooo_indices(hid_t fapl)
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: Tests global heap.
+ * Purpose: Tests global heap.
*
- * Return: Success: zero
- *
- * Failure: non-zero
- *
- * Programmer: Robb Matzke
- * Tuesday, March 31, 1998
- *
- * Modifications:
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
*-------------------------------------------------------------------------
*/
int
main (void)
{
- int nerrors=0;
- hid_t fapl;
+ int nerrors = 0;
+ hid_t fapl_id = H5I_INVALID_HID;
hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
h5_reset();
- fapl = h5_fileaccess();
+ if ((fapl_id = h5_fileaccess()) < 0)
+ goto error;
/* Push API context */
if(H5CX_push() < 0) FAIL_STACK_ERROR
api_ctx_pushed = TRUE;
- nerrors += test_1(fapl);
- nerrors += test_2(fapl);
- nerrors += test_3(fapl);
- nerrors += test_4(fapl);
- nerrors += test_ooo_indices(fapl);
+ nerrors += test_1(fapl_id);
+ nerrors += test_2(fapl_id);
+ nerrors += test_3(fapl_id);
+ nerrors += test_4(fapl_id);
+ nerrors += test_ooo_indices(fapl_id);
/* Verify symbol table messages are cached */
- nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0);
+ nerrors += (h5_verify_cached_stabs(FILENAME, fapl_id) < 0 ? 1 : 0);
if (nerrors)
goto error;
- puts("All global heap tests passed.");
+
+ HDputs("All global heap tests passed.");
/* Pop API context */
if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR
api_ctx_pushed = FALSE;
- h5_cleanup(FILENAME, fapl);
- return 0;
+ h5_cleanup(FILENAME, fapl_id);
+ HDexit(EXIT_SUCCESS);
error:
- puts("*** TESTS FAILED ***");
+ H5E_BEGIN_TRY {
+ H5Pclose(fapl_id);
+ } H5E_END_TRY;
if(api_ctx_pushed) H5CX_pop();
- return 1;
-}
+ HDputs("*** TESTS FAILED ***");
+ HDexit(EXIT_FAILURE);
+} /* end main() */
diff --git a/test/h5test.c b/test/h5test.c
index 0d7603f..cd5b1b1 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -225,6 +225,14 @@ h5_clean_files(const char *base_name[], hid_t fapl)
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * sub_filename in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
void
h5_delete_test_file(const char *base_name, hid_t fapl)
{
@@ -267,13 +275,14 @@ h5_delete_test_file(const char *base_name, hid_t fapl)
for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) {
HDsnprintf(sub_filename, sizeof(sub_filename), "%s-%c.h5", filename, multi_letters[mt]);
HDremove(sub_filename);
- } /* end for */
+ }
} else {
HDremove(filename);
- } /* end if */
+ } /* end driver selection tree */
return;
} /* end h5_delete_test_file() */
+#pragma GCC diagnostic pop
/*-------------------------------------------------------------------------
@@ -610,7 +619,7 @@ h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix,
/* Must first check fapl is not H5P_DEFAULT (-1) because H5FD_XXX
* could be of value -1 if it is not defined.
*/
- isppdriver = H5P_DEFAULT != fapl && (H5FD_MPIO==driver);
+ isppdriver = H5P_DEFAULT != fapl && (H5FD_MPIO == driver);
/* Check HDF5_NOCLEANUP environment setting.
* (The #ifdef is needed to prevent compile failure in case MPI is not
@@ -805,8 +814,8 @@ h5_rmprefix(const char *filename)
* but with a file driver set according to the constant or
* environment variable HDF5_DRIVER
*
- * Return: Success: A file access property list
- * Failure: -1
+ * Return: Success: A file access property list
+ * Failure: H5I_INVALID_HID
*
* Programmer: Robb Matzke
* Thursday, November 19, 1998
@@ -819,7 +828,7 @@ h5_fileaccess(void)
const char *val = NULL;
const char *name;
char s[1024];
- hid_t fapl = -1;
+ hid_t fapl = H5I_INVALID_HID;
/* First use the environment variable, then the constant */
val = HDgetenv("HDF5_DRIVER");
@@ -1192,7 +1201,7 @@ h5_set_info_object(void)
int ret_value=0;
/* handle any MPI INFO hints via $HDF5_MPI_INFO */
- if ((envp = getenv("HDF5_MPI_INFO")) != NULL){
+ if ((envp = HDgetenv("HDF5_MPI_INFO")) != NULL){
char *next, *valp;
valp = envp = next = HDstrdup(envp);
@@ -1254,7 +1263,7 @@ h5_set_info_object(void)
/* actually set the darned thing */
if (MPI_SUCCESS != MPI_Info_set(h5_io_info_g, namep, valp)) {
- printf("MPI_Info_set failed\n");
+ HDprintf("MPI_Info_set failed\n");
ret_value = -1;
}
}
@@ -1317,6 +1326,14 @@ h5_dump_info_object(MPI_Info info)
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * temp in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
h5_stat_size_t
h5_get_file_size(const char *filename, hid_t fapl)
{
@@ -1418,6 +1435,7 @@ h5_get_file_size(const char *filename, hid_t fapl)
return(-1);
} /* end get_file_size() */
+#pragma GCC diagnostic pop
/*
* This routine is designed to provide equivalent functionality to 'printf'
@@ -1430,9 +1448,9 @@ print_func(const char *format, ...)
va_list arglist;
int ret_value;
- va_start(arglist, format);
+ HDva_start(arglist, format);
ret_value = vprintf(format, arglist);
- va_end(arglist);
+ HDva_end(arglist);
return ret_value;
}
@@ -1517,7 +1535,7 @@ getenv_all(MPI_Comm comm, int root, const char* name)
int len;
static char* env = NULL;
- assert(name);
+ HDassert(name);
MPI_Initialized(&mpi_initialized);
MPI_Finalized(&mpi_finalized);
@@ -1525,7 +1543,7 @@ getenv_all(MPI_Comm comm, int root, const char* name)
if(mpi_initialized && !mpi_finalized) {
MPI_Comm_rank(comm, &mpi_rank);
MPI_Comm_size(comm, &mpi_size);
- assert(root < mpi_size);
+ HDassert(root < mpi_size);
/* The root task does the getenv call
* and sends the result to the other tasks */
@@ -1643,15 +1661,11 @@ error:
*
* Purpose: Callback function for h5_verify_cached_stabs.
*
- * Return: Success: 0
- *
- * Failure: -1
+ * Return: SUCCEED/FAIL
*
* Programmer: Neil Fortner
* Tuesday, April 12, 2011
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1659,9 +1673,9 @@ h5_verify_cached_stabs_cb(hid_t oid, const char H5_ATTR_UNUSED *name,
const H5O_info_t *oinfo, void H5_ATTR_UNUSED *udata)
{
if(oinfo->type == H5O_TYPE_GROUP)
- return(H5G__verify_cached_stabs_test(oid));
+ return H5G__verify_cached_stabs_test(oid);
else
- return(0);
+ return SUCCEED;
} /* end h5_verify_cached_stabs_cb() */
diff --git a/test/h5test.h b/test/h5test.h
index afd3a4c..1b057a6 100644
--- a/test/h5test.h
+++ b/test/h5test.h
@@ -102,7 +102,7 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */
* the H5_FAILED() macro is invoked automatically when an API function fails.
*/
#define TESTING(WHAT) {printf("Testing %-62s",WHAT); fflush(stdout);}
-#define TESTING_2(WHAT) {printf(" Testing %-62s",WHAT); fflush(stdout);}
+#define TESTING_2(WHAT) {printf(" Testing %-60s",WHAT); fflush(stdout);}
#define PASSED() {puts(" PASSED");fflush(stdout);}
#define H5_FAILED() {puts("*FAILED*");fflush(stdout);}
#define H5_WARNING() {puts("*WARNING*");fflush(stdout);}
diff --git a/test/mf.c b/test/mf.c
index 04b7c0b..1bd8307 100644
--- a/test/mf.c
+++ b/test/mf.c
@@ -6114,7 +6114,7 @@ test_mf_fs_persist_split(void)
TESTING("File's free-space managers are persistent for split-file");
- /* for now, we don't support persistent free space managers
+ /* for now, we don't support persistent free space managers
* with the split file driver.
*/
SKIPPED();
@@ -6124,7 +6124,7 @@ test_mf_fs_persist_split(void)
/* File creation property list template */
if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
- /* for now, we don't support persistent free space managers
+ /* for now, we don't support persistent free space managers
* with the split file driver.
*/
SKIPPED();
@@ -6436,14 +6436,14 @@ test_mf_fs_persist_multi(void)
TESTING("File's free-space managers are persistent for multi-file");
- /* for now, we don't support persistent free space managers
+ /* for now, we don't support persistent free space managers
* with the multi file driver.
*/
SKIPPED();
HDfprintf(stdout, " Persistent FSMs disabled in multi file driver.\n");
return 0; /* <========== note return */
- /* for now, we don't support persistent free space managers
+ /* for now, we don't support persistent free space managers
* with the multi file driver.
*/
SKIPPED();
@@ -7614,7 +7614,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl)
hid_t fcpl = -1; /* File creation property list */
hid_t fapl_new = -1; /* File access property list ID */
H5F_t *f = NULL; /* Internal file object pointer */
- haddr_t addr2, addr3; /* Addresses for small meta data blocks */
+ haddr_t addr2, addr3; /* Addresses for small metadata blocks */
haddr_t saddr1; /* Addresses for small raw data blocks */
haddr_t gaddr1; /* Addresses for large data blocks */
hbool_t split = FALSE, multi = FALSE;
@@ -7661,7 +7661,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl)
if(NULL == (f = (H5F_t *)H5I_object(fid)))
TEST_ERROR
- /* Allocate 3 small meta data blocks: addr1, addr2, addr3 */
+ /* Allocate 3 small metadata blocks: addr1, addr2, addr3 */
H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE30);
addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE1034);
addr3 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE50);
@@ -7673,7 +7673,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl)
H5MF__alloc_to_fs_type(f, H5FD_MEM_OHDR, TBLOCK_SIZE1034, (H5F_mem_page_t *)&fs_type);
- /* Verify that the freed block with addr2 is found from the small meta data manager */
+ /* Verify that the freed block with addr2 is found from the small metadata manager */
if(H5MF__find_sect(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE1034, f->shared->fs_man[fs_type], &found_addr) < 0)
TEST_ERROR
if(found_addr != addr2)
@@ -7735,7 +7735,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl)
if(!H5F_addr_defined(f->shared->fs_addr[fs_type]))
TEST_ERROR
- /* Verify that the small meta data manager is there */
+ /* Verify that the small metadata manager is there */
H5MF__alloc_to_fs_type(f, H5FD_MEM_OHDR, f->shared->fs_page_size - 1, (H5F_mem_page_t *)&fs_type);
if(!H5F_addr_defined(f->shared->fs_addr[fs_type]))
TEST_ERROR
@@ -7755,7 +7755,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl)
if(H5MF__open_fstype(f, fs_type) < 0)
TEST_ERROR
- /* Verify that the freed block with addr2 is found from the small meta data manager */
+ /* Verify that the freed block with addr2 is found from the small metadata manager */
if(H5MF__find_sect(f, H5FD_MEM_OHDR, (hsize_t)(f->shared->fs_page_size-(addr3+TBLOCK_SIZE50)), f->shared->fs_man[fs_type], &found_addr) < 0)
TEST_ERROR
@@ -7838,7 +7838,7 @@ test_page_try_shrink(const char *env_h5_drvr, hid_t fapl)
hid_t fid = -1; /* File ID */
hid_t fcpl = -1; /* File creation property list */
H5F_t *f = NULL; /* Internal file object pointer */
- haddr_t addr1; /* Address for small meta data block */
+ haddr_t addr1; /* Address for small metadata block */
haddr_t saddr1; /* Address for small raw data block */
haddr_t gaddr1; /* Address for large data block */
hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
@@ -7872,14 +7872,14 @@ test_page_try_shrink(const char *env_h5_drvr, hid_t fapl)
if(NULL == (f = (H5F_t *)H5I_object(fid)))
FAIL_STACK_ERROR
- /* Allocate a small meta data block with addr1 */
+ /* Allocate a small metadata block with addr1 */
addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE50);
/* Try to shrink the block with addr1 */
if((status = H5MF_try_shrink(f, H5FD_MEM_OHDR, addr1, (hsize_t)TBLOCK_SIZE50)) < 0)
FAIL_STACK_ERROR
- /* Couldn't shrink due to the section (remaining space in the page) is in the small meta data free-space manager */
+ /* Couldn't shrink due to the section (remaining space in the page) is in the small metadata free-space manager */
if(status == TRUE) TEST_ERROR
/* Allocate a small raw data block with saddr1 */
@@ -7961,7 +7961,7 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl)
hid_t fid = -1; /* File ID */
hid_t fcpl = -1; /* File creation property list */
H5F_t *f = NULL; /* Internal file object pointer */
- haddr_t addr1, addr2, addr3; /* Addresses for small meta data blocks */
+ haddr_t addr1, addr2, addr3; /* Addresses for small metadata blocks */
haddr_t saddr1; /* Address for small raw data block */
hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
htri_t was_extended; /* Whether the block can be extended or not */
@@ -7993,7 +7993,7 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl)
if(NULL == (f = (H5F_t *)H5I_object(fid)))
FAIL_STACK_ERROR
- /* Allocate a small meta data block with addr1 */
+ /* Allocate a small metadata block with addr1 */
addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE98);
/* Try extending the block with addr1 at EOF not crossing page boundary */
@@ -8001,7 +8001,7 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl)
/* Should succeed */
if(was_extended != TRUE) TEST_ERROR
- /* Allocate 2 small meta data blocks with addr2 and addr3--will be on another meta data page */
+ /* Allocate 2 small metadata blocks with addr2 and addr3--will be on another metadata page */
addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE100);
addr3 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE150);
@@ -8028,7 +8028,7 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl)
/* Free the block with addr1 */
H5MF_xfree(f, H5FD_MEM_OHDR, addr1, (hsize_t)TBLOCK_SIZE3248);
- /* Allocate a new meta data block with addr1 */
+ /* Allocate a new metadata block with addr1 */
/* There is a page end threshold of size H5F_FILE_SPACE_PGEND_META_THRES at the end of the block */
/* The block is right next to the threshold */
addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE3286);
@@ -8409,7 +8409,7 @@ test_page_small(const char *env_h5_drvr, hid_t fapl)
hid_t fcpl = -1; /* File creation property list */
H5F_t *f = NULL; /* Internal file object pointer */
haddr_t addr2, addr3, addr4, addr5; /* Addresses for blocks */
- haddr_t addr9, addr10, addr11; /* Address for small meta data blocks */
+ haddr_t addr9, addr10, addr11; /* Address for small metadata blocks */
haddr_t saddr1, saddr2; /* Addresses for small raw data blocks */
H5FS_stat_t fs_stat; /* Information for free-space manager */
char filename[FILENAME_LEN]; /* Filename to use */
@@ -8445,7 +8445,7 @@ test_page_small(const char *env_h5_drvr, hid_t fapl)
if(NULL == (f = (H5F_t *)H5I_object(fid)))
FAIL_STACK_ERROR
- /* Allocate 2 small meta data blocks: addr1, addr2 */
+ /* Allocate 2 small metadata blocks: addr1, addr2 */
H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE30);
addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE50);
@@ -8464,13 +8464,13 @@ test_page_small(const char *env_h5_drvr, hid_t fapl)
if(saddr2 != (saddr1 + TBLOCK_SIZE30))
TEST_ERROR
- /* Allocate a small meta data block with addr3--there is no free-space section big enough to fulfill the request */
+ /* Allocate a small metadata block with addr3--there is no free-space section big enough to fulfill the request */
addr3 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE4020);
/* Should be on the third page and page aligned */
if(addr3 % TBLOCK_SIZE4096)
TEST_ERROR
- /* Allocate a small meta data block with addr4--there is a free-space section big enough to fulfill the request */
+ /* Allocate a small metadata block with addr4--there is a free-space section big enough to fulfill the request */
addr4 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE80);
/* Should not be page aligned */
if(!(addr4 % TBLOCK_SIZE4096))
@@ -8479,7 +8479,7 @@ test_page_small(const char *env_h5_drvr, hid_t fapl)
if(addr4 != (addr2 + TBLOCK_SIZE50))
TEST_ERROR
- /* Allocate a small meta data block with addr5--there is a free-space section big enough to fulfill the request */
+ /* Allocate a small metadata block with addr5--there is a free-space section big enough to fulfill the request */
addr5 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE40);
/* Should not be page aligned */
if(!(addr5 % TBLOCK_SIZE4096))
@@ -8489,16 +8489,16 @@ test_page_small(const char *env_h5_drvr, hid_t fapl)
if(addr5 != (addr3 + TBLOCK_SIZE4020))
TEST_ERROR
- /* Allocate a small meta data block with addr6--taking up the remaining space in the first page */
+ /* Allocate a small metadata block with addr6--taking up the remaining space in the first page */
if(family)
H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE3080);
else
H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE3088);
- /* Allocate a small meta data block with addr7--taking up the remaining space in the third page */
+ /* Allocate a small metadata block with addr7--taking up the remaining space in the third page */
H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE36);
- /* Allocate 2 small meta data blocks: addr8, addr9--there is no free-space to fulfill the request */
+ /* Allocate 2 small metadata blocks: addr8, addr9--there is no free-space to fulfill the request */
H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE50);
addr9 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE80);
@@ -8514,13 +8514,13 @@ test_page_small(const char *env_h5_drvr, hid_t fapl)
if(fs_stat.tot_space != TBLOCK_SIZE4096)
TEST_ERROR
- /* Allocate a small meta data block with addr10--there is a free-space section big enough to fulfill the request */
+ /* Allocate a small metadata block with addr10--there is a free-space section big enough to fulfill the request */
addr10 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE3900);
/* The block should be next to the block with addr9 */
if(addr10 != (addr9 + TBLOCK_SIZE80))
TEST_ERROR
- /* Allocate a small meta data block with addr11 */
+ /* Allocate a small metadata block with addr11 */
/* The current free-space section is unable to fulfill the request; obtain a page from the large manager */
addr11 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE80);
/* The address of the block should be the same the freed block with saddr1 */
@@ -8575,7 +8575,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl)
hid_t fcpl2 = -1; /* File creation property list ID */
hid_t fapl_new = -1; /* File access property list ID */
H5F_t *f = NULL; /* Internal file object pointer */
- haddr_t addr1, addr2; /* Addresses for small meta data blocks */
+ haddr_t addr1, addr2; /* Addresses for small metadata blocks */
haddr_t saddr1, saddr2; /* Addresses for small raw data blocks */
haddr_t gaddr1, gaddr2; /* Addresses for blocks */
char filename[FILENAME_LEN]; /* Filename to use */
@@ -8729,7 +8729,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl)
/* Disable small data block mechanism */
if(H5Pset_small_data_block_size(fapl_new, (hsize_t)0) < 0)
TEST_ERROR
- /* Disable meta data block mechanism */
+ /* Disable metadata block mechanism */
if(H5Pset_meta_block_size(fapl_new, (hsize_t)0) < 0)
TEST_ERROR
@@ -8741,7 +8741,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl)
if(NULL == (f = (H5F_t *)H5I_object(fid)))
TEST_ERROR
- /* Allocate 2 small meta data blocks */
+ /* Allocate 2 small metadata blocks */
addr1 = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30);
addr2 = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE50);
diff --git a/test/swmr.c b/test/swmr.c
index 0b352e2..e03d0c5 100644
--- a/test/swmr.c
+++ b/test/swmr.c
@@ -6484,106 +6484,104 @@ test_refresh_concur(hid_t in_fapl, hbool_t new_format)
if(childpid == 0) { /* Child process */
hid_t child_fid1 = -1; /* File ID */
hid_t child_fid2 = -1; /* File ID */
- hid_t child_did1 = -1, child_did2 = -1;
- hid_t child_sid = -1;
- hsize_t tdims[1];
- int rbuf[2] = {0, 0};
- int child_notify = 0;
+ hid_t child_did1 = -1, child_did2 = -1;
+ hid_t child_sid = -1;
+ hsize_t tdims[1];
+ int rbuf[2] = {0, 0};
+ int child_notify = 0;
- /* Close unused write end for out_pdf */
- if(HDclose(out_pdf[1]) < 0)
- HDexit(EXIT_FAILURE);
+ /* Close unused write end for out_pdf */
+ if(HDclose(out_pdf[1]) < 0)
+ HDexit(EXIT_FAILURE);
- /* close unused read end for in_pdf */
- if(HDclose(in_pdf[0]) < 0)
- HDexit(EXIT_FAILURE);
+ /* close unused read end for in_pdf */
+ if(HDclose(in_pdf[0]) < 0)
+ HDexit(EXIT_FAILURE);
- /* Wait for notification from parent process */
- while(child_notify != 1) {
- if(HDread(out_pdf[0], &child_notify, sizeof(int)) < 0)
- HDexit(EXIT_FAILURE);
- }
+ /* Wait for notification from parent process */
+ while(child_notify != 1)
+ if(HDread(out_pdf[0], &child_notify, sizeof(int)) < 0)
+ HDexit(EXIT_FAILURE);
- /* Open the file 2 times */
- if((child_fid1 = H5Fopen(filename, H5F_ACC_RDONLY|H5F_ACC_SWMR_READ, fapl)) < 0)
- HDexit(EXIT_FAILURE);
+ /* Open the file 2 times */
+ if((child_fid1 = H5Fopen(filename, H5F_ACC_RDONLY|H5F_ACC_SWMR_READ, fapl)) < 0)
+ HDexit(EXIT_FAILURE);
- if((child_fid2 = H5Fopen(filename, H5F_ACC_RDONLY|H5F_ACC_SWMR_READ, fapl)) < 0)
- HDexit(EXIT_FAILURE);
+ if((child_fid2 = H5Fopen(filename, H5F_ACC_RDONLY|H5F_ACC_SWMR_READ, fapl)) < 0)
+ HDexit(EXIT_FAILURE);
- /* Open the dataset 2 times */
- if((child_did1 = H5Dopen2(child_fid1, "dataset", H5P_DEFAULT)) < 0)
- HDexit(EXIT_FAILURE);
- if((child_did2 = H5Dopen2(child_fid2, "dataset", H5P_DEFAULT)) < 0)
- HDexit(EXIT_FAILURE);
+ /* Open the dataset 2 times */
+ if((child_did1 = H5Dopen2(child_fid1, "dataset", H5P_DEFAULT)) < 0)
+ HDexit(EXIT_FAILURE);
+ if((child_did2 = H5Dopen2(child_fid2, "dataset", H5P_DEFAULT)) < 0)
+ HDexit(EXIT_FAILURE);
- /* Get the dataset's dataspace via did1 */
- if((child_sid = H5Dget_space(child_did1)) < 0)
- HDexit(EXIT_FAILURE);
- if(H5Sget_simple_extent_dims(child_sid, tdims, NULL) < 0)
- HDexit(EXIT_FAILURE);
- if(tdims[0] != 1)
- HDexit(EXIT_FAILURE);
+ /* Get the dataset's dataspace via did1 */
+ if((child_sid = H5Dget_space(child_did1)) < 0)
+ HDexit(EXIT_FAILURE);
+ if(H5Sget_simple_extent_dims(child_sid, tdims, NULL) < 0)
+ HDexit(EXIT_FAILURE);
+ if(tdims[0] != 1)
+ HDexit(EXIT_FAILURE);
- /* Read from the dataset via did2 */
- if(H5Dread(child_did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
- HDexit(EXIT_FAILURE);
+ /* Read from the dataset via did2 */
+ if(H5Dread(child_did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
+ HDexit(EXIT_FAILURE);
- /* Verify the data is correct */
- if(rbuf[0] != 99)
- HDexit(EXIT_FAILURE);
+ /* Verify the data is correct */
+ if(rbuf[0] != 99)
+ HDexit(EXIT_FAILURE);
- /* Notify parent process */
- child_notify = 2;
- if(HDwrite(in_pdf[1], &child_notify, sizeof(int)) < 0)
- HDexit(EXIT_FAILURE);
+ /* Notify parent process */
+ child_notify = 2;
+ if(HDwrite(in_pdf[1], &child_notify, sizeof(int)) < 0)
+ HDexit(EXIT_FAILURE);
- /* Wait for notification from parent process */
- while(child_notify != 3) {
- if(HDread(out_pdf[0], &child_notify, sizeof(int)) < 0)
- HDexit(EXIT_FAILURE);
- }
+ /* Wait for notification from parent process */
+ while(child_notify != 3)
+ if(HDread(out_pdf[0], &child_notify, sizeof(int)) < 0)
+ HDexit(EXIT_FAILURE);
- /* Refresh dataset via did1 */
- if(H5Drefresh(child_did1) < 0)
- HDexit(EXIT_FAILURE);
+ /* Refresh dataset via did1 */
+ if(H5Drefresh(child_did1) < 0)
+ HDexit(EXIT_FAILURE);
- /* Get the dataset's dataspace and verify */
- if((child_sid = H5Dget_space(child_did1)) < 0)
- HDexit(EXIT_FAILURE);
- if(H5Sget_simple_extent_dims(child_sid, tdims, NULL) < 0)
- HDexit(EXIT_FAILURE);
+ /* Get the dataset's dataspace and verify */
+ if((child_sid = H5Dget_space(child_did1)) < 0)
+ HDexit(EXIT_FAILURE);
+ if(H5Sget_simple_extent_dims(child_sid, tdims, NULL) < 0)
+ HDexit(EXIT_FAILURE);
- if(tdims[0] != 2)
- HDexit(EXIT_FAILURE);
+ if(tdims[0] != 2)
+ HDexit(EXIT_FAILURE);
- /* Read from the dataset */
- if(H5Dread(child_did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
- HDexit(EXIT_FAILURE);
+ /* Read from the dataset */
+ if(H5Dread(child_did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
+ HDexit(EXIT_FAILURE);
- /* Verify the data is correct */
- if(rbuf[0] != 100 || rbuf[1] != 100)
- HDexit(EXIT_FAILURE);
+ /* Verify the data is correct */
+ if(rbuf[0] != 100 || rbuf[1] != 100)
+ HDexit(EXIT_FAILURE);
- /* Close the 2 datasets */
- if(H5Dclose(child_did1) < 0)
- HDexit(EXIT_FAILURE);
- if(H5Dclose(child_did2) < 0)
- HDexit(EXIT_FAILURE);
+ /* Close the 2 datasets */
+ if(H5Dclose(child_did1) < 0)
+ HDexit(EXIT_FAILURE);
+ if(H5Dclose(child_did2) < 0)
+ HDexit(EXIT_FAILURE);
- /* Close the 2 files */
- if(H5Fclose(child_fid1) < 0)
- HDexit(EXIT_FAILURE);
- if(H5Fclose(child_fid2) < 0)
- HDexit(EXIT_FAILURE);
+ /* Close the 2 files */
+ if(H5Fclose(child_fid1) < 0)
+ HDexit(EXIT_FAILURE);
+ if(H5Fclose(child_fid2) < 0)
+ HDexit(EXIT_FAILURE);
- /* Close the pipes */
- if(HDclose(out_pdf[0]) < 0)
- HDexit(EXIT_FAILURE);
- if(HDclose(in_pdf[1]) < 0)
- HDexit(EXIT_FAILURE);
+ /* Close the pipes */
+ if(HDclose(out_pdf[0]) < 0)
+ HDexit(EXIT_FAILURE);
+ if(HDclose(in_pdf[1]) < 0)
+ HDexit(EXIT_FAILURE);
- HDexit(EXIT_SUCCESS);
+ HDexit(EXIT_SUCCESS);
}
/* Close unused read end for out_pdf */
@@ -6618,8 +6616,8 @@ test_refresh_concur(hid_t in_fapl, hbool_t new_format)
/* Wait for notification from child process */
while(notify != 2) {
- if(HDread(in_pdf[0], &notify, sizeof(int)) < 0)
- FAIL_STACK_ERROR;
+ if(HDread(in_pdf[0], &notify, sizeof(int)) < 0)
+ FAIL_STACK_ERROR;
}
/* Cork the metadata cache, to prevent the object header from being
@@ -7043,7 +7041,7 @@ main(void)
*/
driver = HDgetenv("HDF5_DRIVER");
if(!H5FD_supports_swmr_test(driver)) {
- printf("This VFD does not support SWMR I/O\n");
+ HDprintf("This VFD does not support SWMR I/O\n");
return EXIT_SUCCESS;
} /* end if */
@@ -7133,7 +7131,7 @@ main(void)
if(nerrors)
goto error;
- printf("All tests passed.\n");
+ HDprintf("All tests passed.\n");
h5_cleanup(FILENAME, fapl);
@@ -7141,7 +7139,7 @@ main(void)
error:
nerrors = MAX(1, nerrors);
- printf("***** %d SWMR TEST%s FAILED! *****\n",
+ HDprintf("***** %d SWMR TEST%s FAILED! *****\n",
nerrors, 1 == nerrors ? "" : "S");
return EXIT_FAILURE;
diff --git a/test/tattr.c b/test/tattr.c
index 7e07ee0..6edbc69 100644
--- a/test/tattr.c
+++ b/test/tattr.c
@@ -571,107 +571,118 @@ test_attr_flush(hid_t fapl)
static void
test_attr_plist(hid_t fapl)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1,sid2; /* Dataspace ID */
- hid_t attr; /* Attribute ID */
- hid_t plist; /* Property list ID */
- hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
- hsize_t dims2[] = {ATTR1_DIM1};
- H5T_cset_t cset; /* Character set for attributes */
- herr_t ret; /* Generic return value */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t did = H5I_INVALID_HID; /* Dataset ID */
+ hid_t dsid = H5I_INVALID_HID; /* Dataspace ID (for dataset) */
+ hid_t asid = H5I_INVALID_HID; /* Dataspace ID (for attribute) */
+ hid_t aid = H5I_INVALID_HID; /* Attribute ID */
+ hid_t acpl_id = H5I_INVALID_HID; /* Attribute creation property list ID */
+ hid_t aapl_id = H5I_INVALID_HID; /* Attribute access property list ID */
+ hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
+ hsize_t dims2[] = {ATTR1_DIM1};
+ H5T_cset_t cset; /* Character set for attributes */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Attribute Property Lists\n"));
/* Create file */
- fid1 = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
- CHECK(fid1, FAIL, "H5Fcreate");
+ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
/* Create dataspace for dataset */
- sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
- CHECK(sid1, FAIL, "H5Screate_simple");
+ dsid = H5Screate_simple(SPACE1_RANK, dims1, NULL);
+ CHECK(dsid, H5I_INVALID_HID, "H5Screate_simple");
/* Create a dataset */
- dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate2");
+ did = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, dsid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
+ CHECK(did, H5I_INVALID_HID, "H5Dcreate2");
/* Create dataspace for attribute */
- sid2 = H5Screate_simple(ATTR1_RANK, dims2, NULL);
- CHECK(sid2, FAIL, "H5Screate_simple");
+ asid = H5Screate_simple(ATTR1_RANK, dims2, NULL);
+ CHECK(asid, H5I_INVALID_HID, "H5Screate_simple");
- /* Create default property list for attribute */
- plist = H5Pcreate(H5P_ATTRIBUTE_CREATE);
- CHECK(plist, FAIL, "H5Pcreate");
+ /* Create default creation property list for attribute */
+ acpl_id = H5Pcreate(H5P_ATTRIBUTE_CREATE);
+ CHECK(acpl_id, H5I_INVALID_HID, "H5Pcreate");
+
+ /* Create default access property list for attribute
+ * This currently has no properties, but we need to test its creation
+ * and use.
+ */
+ aapl_id = H5Pcreate(H5P_ATTRIBUTE_ACCESS);
+ CHECK(aapl_id, H5I_INVALID_HID, "H5Pcreate");
/* Get the character encoding and ensure that it is the default (ASCII) */
- ret = H5Pget_char_encoding(plist, &cset);
+ ret = H5Pget_char_encoding(acpl_id, &cset);
CHECK(ret, FAIL, "H5Pget_char_encoding");
VERIFY(cset, H5T_CSET_ASCII, "H5Pget_char_encoding");
/* Create an attribute for the dataset using the property list */
- attr = H5Acreate2(dataset, ATTR1_NAME, H5T_NATIVE_INT, sid2, plist, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate2");
+ aid = H5Acreate2(did, ATTR1_NAME, H5T_NATIVE_INT, asid, acpl_id, aapl_id);
+ CHECK(aid, H5I_INVALID_HID, "H5Acreate2");
- /* Close the property list, and get the attribute's property list */
- ret = H5Pclose(plist);
+ /* Close the property list, and get the attribute's creation property list */
+ ret = H5Pclose(acpl_id);
CHECK(ret, FAIL, "H5Pclose");
- plist = H5Aget_create_plist(attr);
- CHECK(plist, FAIL, "H5Aget_create_plist");
+ acpl_id = H5Aget_create_plist(aid);
+ CHECK(acpl_id, H5I_INVALID_HID, "H5Aget_create_plist");
/* Get the character encoding and ensure that it is the default (ASCII) */
- ret = H5Pget_char_encoding(plist, &cset);
+ ret = H5Pget_char_encoding(acpl_id, &cset);
CHECK(ret, FAIL, "H5Pget_char_encoding");
VERIFY(cset, H5T_CSET_ASCII, "H5Pget_char_encoding");
/* Close the property list and attribute */
- ret = H5Pclose(plist);
+ ret = H5Pclose(acpl_id);
CHECK(ret, FAIL, "H5Pclose");
- ret = H5Aclose(attr);
+ ret = H5Aclose(aid);
CHECK(ret, FAIL, "H5Aclose");
/* Create a new property list and modify it to use a different encoding */
- plist = H5Pcreate(H5P_ATTRIBUTE_CREATE);
- CHECK(plist, FAIL, "H5Pcreate");
- ret = H5Pset_char_encoding(plist, H5T_CSET_UTF8);
+ acpl_id = H5Pcreate(H5P_ATTRIBUTE_CREATE);
+ CHECK(acpl_id, H5I_INVALID_HID, "H5Pcreate");
+ ret = H5Pset_char_encoding(acpl_id, H5T_CSET_UTF8);
CHECK(ret, FAIL, "H5Pset_char_encoding");
/* Get the character encoding and ensure that it has been changed */
- ret = H5Pget_char_encoding(plist, &cset);
+ ret = H5Pget_char_encoding(acpl_id, &cset);
CHECK(ret, FAIL, "H5Pget_char_encoding");
VERIFY(cset, H5T_CSET_UTF8, "H5Pget_char_encoding");
/* Create an attribute for the dataset using the modified property list */
- attr = H5Acreate2(dataset, ATTR2_NAME, H5T_NATIVE_INT, sid2, plist, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate2");
+ aid = H5Acreate2(did, ATTR2_NAME, H5T_NATIVE_INT, asid, acpl_id, aapl_id);
+ CHECK(aid, H5I_INVALID_HID, "H5Acreate2");
/* Close the property list and attribute */
- ret = H5Pclose(plist);
+ ret = H5Pclose(acpl_id);
CHECK(ret, FAIL, "H5Pclose");
- ret = H5Aclose(attr);
+ ret = H5Aclose(aid);
CHECK(ret, FAIL, "H5Aclose");
/* Re-open the second attribute and ensure that its character encoding is correct */
- attr = H5Aopen(dataset, ATTR2_NAME, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Aopen");
- plist = H5Aget_create_plist(attr);
- CHECK(plist, FAIL, "H5Aget_create_plist");
- ret = H5Pget_char_encoding(plist, &cset);
+ aid = H5Aopen(did, ATTR2_NAME, H5P_DEFAULT);
+ CHECK(aid, H5I_INVALID_HID, "H5Aopen");
+ acpl_id = H5Aget_create_plist(aid);
+ CHECK(acpl_id, H5I_INVALID_HID, "H5Aget_create_plist");
+ ret = H5Pget_char_encoding(acpl_id, &cset);
CHECK(ret, FAIL, "H5Pget_char_encoding");
VERIFY(cset, H5T_CSET_UTF8, "H5Pget_char_encoding");
/* Close everything */
- ret=H5Sclose(sid1);
+ ret = H5Sclose(dsid);
CHECK(ret, FAIL, "H5Sclose");
- ret=H5Sclose(sid2);
+ ret = H5Sclose(asid);
CHECK(ret, FAIL, "H5Sclose");
- ret = H5Pclose(plist);
+ ret = H5Pclose(aapl_id);
+ CHECK(ret, FAIL, "H5Pclose");
+ ret = H5Pclose(acpl_id);
CHECK(ret, FAIL, "H5Pclose");
- ret=H5Aclose(attr);
+ ret = H5Aclose(aid);
CHECK(ret, FAIL, "H5Aclose");
- ret=H5Dclose(dataset);
+ ret = H5Dclose(did);
CHECK(ret, FAIL, "H5Dclose");
- ret=H5Fclose(fid1);
+ ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_plist() */
@@ -2166,9 +2177,14 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl)
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
- /* Query the group creation properties */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ /* need DCPL to query the group creation properties */
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Create a dataset */
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
@@ -2297,9 +2313,14 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl)
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
- /* Query the group creation properties */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ /* need DCPL to query the group creation properties */
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Enable creation order tracking on attributes, so creation order tests work */
ret = H5Pset_attr_creation_order(dcpl, H5P_CRT_ORDER_TRACKED);
@@ -2432,7 +2453,6 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl)
if (use_min_dset_oh)
CHECK(H5Pclose(fcpl), FAIL, "H5Pclose");
-
/* Close file */
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
@@ -2450,9 +2470,14 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl)
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
- /* Query the group creation properties */
- dcpl = (use_min_dset_oh) ? H5Pcopy(dcpl_g) : H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ /* need DCPL to query the group creation properties */
+ if (use_min_dset_oh) {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ } else {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ }
/* Enable creation order tracking on attributes, so creation order tests work */
ret = H5Pset_attr_creation_order(dcpl, H5P_CRT_ORDER_TRACKED);
@@ -2642,9 +2667,14 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl)
sid = H5Screate(H5S_SCALAR);
CHECK(sid, H5I_INVALID_HID, "H5Screate");
- /* Query the group creation properties */
- dcpl = (use_min_dset_oh) ? H5Pcopy(dcpl_g) : H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, H5I_INVALID_HID, "H5Pcopy");
+ /* need DCPL to query the group creation properties */
+ if (use_min_dset_oh) {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, H5I_INVALID_HID, "H5Pcopy");
+ } else {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, H5I_INVALID_HID, "H5Pcreate");
+ }
/* Retrieve limits for compact/dense attribute storage */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
@@ -2807,8 +2837,8 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl)
ret = H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, 1);
CHECK(ret, FAIL, "H5Pset_file_space_strategy");
}
- fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl);
- CHECK(fid, FAIL, "H5Fcreate");
+ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl);
+ CHECK(fid, FAIL, "H5Fcreate");
if (use_min_dset_oh)
CHECK(H5Pclose(fcpl), FAIL, "H5Pclose");
@@ -2829,9 +2859,14 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl)
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
- /* Query the group creation properties */
- dcpl = (use_min_dset_oh) ? H5Pcopy(dcpl_g) : H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ /* need DCPL to query the group creation properties */
+ if (use_min_dset_oh) {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ } else {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ }
/* Create a dataset */
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
@@ -2957,9 +2992,14 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl)
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
- /* Query the group creation properties */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ /* need DCPL to query the group creation properties */
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Change limits on compact/dense attribute storage */
max_compact = 0;
@@ -3124,9 +3164,14 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
- /* Query the group creation properties */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ /* need DCPL to query the group creation properties */
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Create a dataset */
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
@@ -3654,9 +3699,14 @@ test_attr_big(hid_t fcpl, hid_t fapl)
big_sid = H5Screate_simple(ATTR6_RANK, dims, NULL);
CHECK(big_sid, FAIL, "H5Screate_simple");
- /* Query the group creation properties */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ /* need DCPL to query the group creation properties */
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Retrieve limits for compact/dense attribute storage */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
@@ -4128,7 +4178,6 @@ test_attr_deprec(hid_t fcpl, hid_t fapl)
ret = H5Aclose(attr);
CHECK(ret, FAIL, "H5Aclose");
-
/* Close dataspaces */
ret = H5Sclose(sid);
@@ -4350,8 +4399,13 @@ test_attr_corder_create_basic(hid_t fcpl, hid_t fapl)
CHECK(fid, FAIL, "H5Fcreate");
/* Create dataset creation property list */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Get creation order indexing on object */
ret = H5Pget_attr_creation_order(dcpl, &crt_order_flags);
@@ -4473,8 +4527,13 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl)
CHECK(fid, FAIL, "H5Fcreate");
/* Create dataset creation property list */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Set attribute creation order tracking & indexing for object */
ret = H5Pset_attr_creation_order(dcpl, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED));
@@ -4673,8 +4732,13 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl)
CHECK(fid, FAIL, "H5Fcreate");
/* Create dataset creation property list */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Set attribute creation order tracking & indexing for object */
ret = H5Pset_attr_creation_order(dcpl, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED));
@@ -5008,8 +5072,13 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
CHECK(fid, FAIL, "H5Fcreate");
/* Create dataset creation property list */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Set attribute creation order tracking & indexing for object */
ret = H5Pset_attr_creation_order(dcpl, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED));
@@ -5419,8 +5488,13 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl)
CHECK(sid, FAIL, "H5Screate");
/* Create dataset creation property list */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Set attribute creation order tracking & indexing for object */
ret = H5Pset_attr_creation_order(dcpl, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED));
@@ -5762,8 +5836,13 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(sid, FAIL, "H5Screate");
/* Create dataset creation property list */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Query the attribute creation properties */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
@@ -5974,8 +6053,13 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(sid, FAIL, "H5Screate");
/* Create dataset creation property list */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Query the attribute creation properties */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
@@ -6917,8 +7001,13 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(sid, FAIL, "H5Screate");
/* Create dataset creation property list */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Query the attribute creation properties */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
@@ -7278,8 +7367,13 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(sid, FAIL, "H5Screate");
/* Create dataset creation property list */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Query the attribute creation properties */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
@@ -7625,8 +7719,13 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(sid, FAIL, "H5Screate");
/* Create dataset creation property list */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Query the attribute creation properties */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
@@ -7879,8 +7978,13 @@ test_attr_create_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(sid, FAIL, "H5Screate");
/* Create dataset creation property list */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Query the attribute creation properties */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
@@ -8180,8 +8284,13 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl)
} /* end if */
/* Set up to query the object creation properties */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Create datasets */
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
@@ -8511,8 +8620,13 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
} /* end if */
/* Set up to query the object creation properties */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Create datasets */
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
@@ -8957,8 +9071,13 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
} /* end if */
/* Set up to query the object creation properties */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Create datasets */
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
@@ -9326,8 +9445,13 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
} /* end if */
/* Set up to query the object creation properties */
- dcpl = (dcpl_g == H5P_DEFAULT) ? H5Pcreate(H5P_DATASET_CREATE) : H5Pcopy(dcpl_g);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Create datasets */
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
@@ -9735,7 +9859,7 @@ test_attr_bug2(hid_t fcpl, hid_t fapl)
hid_t tid; /* Datatype ID */
hid_t gcpl; /* Group creation property list */
hsize_t dims[2] = {10, 100}; /* Attribute dimensions */
- char aname[4]; /* Attribute name */
+ char aname[16]; /* Attribute name */
unsigned i; /* index */
herr_t ret; /* Generic return status */
htri_t tri_ret; /* htri_t return status */
@@ -10739,7 +10863,7 @@ test_attr_bug9(hid_t fcpl, hid_t fapl)
/****************************************************************
**
-** test_attr_delete_dense():
+** test_attr_delete_dense():
** This is to verify the error as described in HDFFV-9277
** is fixed when deleting the last "large" attribute that
** is stored densely.
@@ -10853,9 +10977,8 @@ test_attr(void)
fcpl = H5Pcreate(H5P_FILE_CREATE);
CHECK(fcpl, FAIL, "H5Pcreate");
- /* files with fcpl make all attributes (> 1 byte) shared
- * i.e., all of them :-)
- */
+ /* files with fcpl2 make all attributes ( > 1 byte) shared
+ * (i.e. all of them :-) */
fcpl2 = H5Pcopy(fcpl);
CHECK(fcpl2, FAIL, "H5Pcopy");
ret = H5Pset_shared_mesg_nindexes(fcpl2, (unsigned)1);
@@ -10883,11 +11006,10 @@ test_attr(void)
if(new_format) {
MESSAGE(7, ("testing with new file format\n"));
my_fapl = fapl2;
- } /* end if */
- else {
+ } else {
MESSAGE(7, ("testing with old file format\n"));
my_fapl = fapl;
- } /* end else */
+ }
/* These next two tests use the same file information */
test_attr_basic_write(my_fapl); /* Test basic H5A writing code */
diff --git a/test/tgenprop.c b/test/tgenprop.c
index 5031846..d5e767f 100644
--- a/test/tgenprop.c
+++ b/test/tgenprop.c
@@ -1774,7 +1774,7 @@ test_genprop_path(void)
CHECK_I(ret, "H5Pregister2");
/* Get full path for first class */
- path=H5P_get_class_path_test(cid1);
+ path = H5P_get_class_path_test(cid1);
CHECK_PTR(path, "H5P_get_class_path_test");
if(HDstrcmp(path,CLASS1_PATH)!=0)
TestErrPrintf("Class names don't match!, path=%s, CLASS1_PATH=%s\n",path,CLASS1_PATH);
@@ -1789,7 +1789,7 @@ test_genprop_path(void)
CHECK_I(ret, "H5Pregister2");
/* Get full path for second class */
- path=H5P_get_class_path_test(cid2);
+ path = H5P_get_class_path_test(cid2);
CHECK_PTR(path, "H5P_get_class_path_test");
if(HDstrcmp(path,CLASS2_PATH)!=0)
TestErrPrintf("Class names don't match!, path=%s, CLASS2_PATH=%s\n",path,CLASS2_PATH);
diff --git a/test/th5s.c b/test/th5s.c
index fa6bba3..ed205df 100644
--- a/test/th5s.c
+++ b/test/th5s.c
@@ -91,12 +91,22 @@ struct space4_struct {
unsigned u;
float f;
char c2;
- } space4_data={'v',987123,-3.14F,'g'}; /* Test data for 4th dataspace */
+} space4_data={'v',987123,-3.14F,'g'}; /* Test data for 4th dataspace */
-
-/* Used in test_h5s_encode_irregular_exceed32() and test_h5s_encode_points_exceed32() */
+/*
+ * Testing configuration defines used by:
+ * test_h5s_encode_regular_hyper()
+ * test_h5s_encode_irregular_hyper()
+ * test_h5s_encode_points()
+ */
+#define CONFIG_8 1
+#define CONFIG_16 2
+#define CONFIG_32 3
+#define POWER8 256 /* 2^8 */
+#define POWER16 65536 /* 2^16 */
#define POWER32 4294967296 /* 2^32 */
+
/****************************************************************
**
** test_h5s_basic(): Test basic H5S (dataspace) code.
@@ -1200,6 +1210,7 @@ test_h5s_encode(void)
sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
CHECK(sid1, FAIL, "H5Screate_simple");
+ /* Set the hyperslab selection */
ret = H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
@@ -1212,7 +1223,7 @@ test_h5s_encode(void)
/* Try decoding bogus buffer */
H5E_BEGIN_TRY {
- ret_id = H5Sdecode(sbuf);
+ ret_id = H5Sdecode(sbuf);
} H5E_END_TRY;
VERIFY(ret_id, FAIL, "H5Sdecode");
@@ -1229,22 +1240,26 @@ test_h5s_encode(void)
VERIFY(n, SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3,
"H5Sget_simple_extent_npoints");
+ /* Retrieve and verify the dataspace rank */
rank = H5Sget_simple_extent_ndims(decoded_sid1);
CHECK(rank, FAIL, "H5Sget_simple_extent_ndims");
VERIFY(rank, SPACE1_RANK, "H5Sget_simple_extent_ndims");
+ /* Retrieve and verify the dataspace dimensions */
rank = H5Sget_simple_extent_dims(decoded_sid1, tdims, NULL);
CHECK(rank, FAIL, "H5Sget_simple_extent_dims");
VERIFY(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(hsize_t)), 0,
"H5Sget_simple_extent_dims");
- /* Verify hyperslabe selection */
+ /* Verify the type of dataspace selection */
sel_type = H5Sget_select_type(decoded_sid1);
VERIFY(sel_type, H5S_SEL_HYPERSLABS, "H5Sget_select_type");
+ /* Verify the number of hyperslab blocks */
nblocks = H5Sget_select_hyper_nblocks(decoded_sid1);
VERIFY(nblocks, 2*2*2, "H5Sget_select_hyper_nblocks");
+ /* Close the dataspaces */
ret = H5Sclose(sid1);
CHECK(ret, FAIL, "H5Sclose");
@@ -1272,10 +1287,11 @@ test_h5s_encode(void)
decoded_sid2=H5Sdecode(null_sbuf);
CHECK(decoded_sid2, FAIL, "H5Sdecode");
- /* Verify decoded dataspace */
+ /* Verify the decoded dataspace type */
space_type = H5Sget_simple_extent_type(decoded_sid2);
VERIFY(space_type, H5S_NULL, "H5Sget_simple_extent_type");
+ /* Close the dataspaces */
ret = H5Sclose(sid2);
CHECK(ret, FAIL, "H5Sclose");
@@ -1313,20 +1329,26 @@ test_h5s_encode(void)
CHECK(n, FAIL, "H5Sget_simple_extent_npoints");
VERIFY(n, 1, "H5Sget_simple_extent_npoints");
+ /* Retrieve and verify the dataspace rank */
rank = H5Sget_simple_extent_ndims(decoded_sid3);
CHECK(rank, FAIL, "H5Sget_simple_extent_ndims");
VERIFY(rank, 0, "H5Sget_simple_extent_ndims");
+ /* Close the dataspaces */
ret = H5Sclose(sid3);
CHECK(ret, FAIL, "H5Sclose");
ret = H5Sclose(decoded_sid3);
CHECK(ret, FAIL, "H5Sclose");
- HDfree(sbuf);
- HDfree(null_sbuf);
- HDfree(scalar_buf);
-} /* test_h5s_encode() */
+ /* Release resources */
+ if(sbuf)
+ HDfree(sbuf);
+ if(null_sbuf)
+ HDfree(null_sbuf);
+ if(scalar_buf)
+ HDfree(scalar_buf);
+} /* test_h5s_encode() */
/****************************************************************
**
@@ -1336,14 +1358,14 @@ test_h5s_encode(void)
static void
test_h5s_scalar_write(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1; /* Dataspace ID */
- int rank; /* Logical rank of dataspace */
- hsize_t tdims[4]; /* Dimension array to test with */
- hssize_t n; /* Number of dataspace elements */
- H5S_class_t ext_type; /* Extent type */
- herr_t ret; /* Generic return value */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1; /* Dataspace ID */
+ int rank; /* Logical rank of dataspace */
+ hsize_t tdims[4]; /* Dimension array to test with */
+ hssize_t n; /* Number of dataspace elements */
+ H5S_class_t ext_type; /* Extent type */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Scalar Dataspace Manipulation during Writing\n"));
@@ -1362,14 +1384,17 @@ test_h5s_scalar_write(void)
sid1 = H5Screate_simple(SPACE3_RANK, NULL, NULL);
CHECK(sid1, FAIL, "H5Screate_simple");
+ /* Retrieve the number of elements in the dataspace selection */
n = H5Sget_simple_extent_npoints(sid1);
CHECK(n, FAIL, "H5Sget_simple_extent_npoints");
VERIFY(n, 1, "H5Sget_simple_extent_npoints");
+ /* Get the dataspace rank */
rank = H5Sget_simple_extent_ndims(sid1);
CHECK(rank, FAIL, "H5Sget_simple_extent_ndims");
VERIFY(rank, SPACE3_RANK, "H5Sget_simple_extent_ndims");
+ /* Get the dataspace dimension sizes */
rank = H5Sget_simple_extent_dims(sid1, tdims, NULL);
VERIFY(rank, 0, "H5Sget_simple_extent_dims");
@@ -1381,6 +1406,7 @@ test_h5s_scalar_write(void)
dataset = H5Dcreate2(fid1, "Dataset1", H5T_NATIVE_UINT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(dataset, FAIL, "H5Dcreate2");
+ /* Write to the dataset */
ret = H5Dwrite(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &space3_data);
CHECK(ret, FAIL, "H5Dwrite");
@@ -1395,7 +1421,7 @@ test_h5s_scalar_write(void)
/* Close file */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
-} /* test_h5s_scalar_write() */
+} /* test_h5s_scalar_write() */
/****************************************************************
**
diff --git a/test/titerate.c b/test/titerate.c
index 696784d..6a75d5b 100644
--- a/test/titerate.c
+++ b/test/titerate.c
@@ -945,7 +945,7 @@ find_err_msg_cb(unsigned n, const H5E_error2_t *err_desc, void *_client_data)
searched_err_t *searched_err = (searched_err_t *)_client_data;
if (searched_err == NULL)
- return -1;
+ return H5_ITER_ERROR;
/* If the searched error message is found, stop the iteration */
if (err_desc->desc != NULL && strcmp(err_desc->desc, searched_err->message) == 0)
@@ -989,6 +989,7 @@ static void test_corrupted_attnamelen(void)
/* Call H5Aiterate2 to trigger the failure in HDFFV-10588. Failure should
occur in the decoding stage, so some arguments are not needed. */
err_status = H5Aiterate2(did, H5_INDEX_NAME, H5_ITER_INC, NULL, NULL, NULL);
+ VERIFY(err_status, FAIL, "H5Aiterate2");
/* Make sure the intended error was caught */
if(err_status == -1)
diff --git a/test/trefer.c b/test/trefer.c
index 1f85b07..78139d2 100644
--- a/test/trefer.c
+++ b/test/trefer.c
@@ -615,7 +615,7 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high)
sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
CHECK(sid1, FAIL, "H5Screate_simple");
- /* Create the reference dataset */
+ /* Create a dataset */
dset1 = H5Dcreate2(fid1, "Dataset1", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Dcreate2");
@@ -1849,10 +1849,10 @@ test_reference(void)
/* Output message about test being performed */
MESSAGE(5, ("Testing References\n"));
- test_reference_params(); /* Test for correct parameter checking */
- test_reference_obj(); /* Test basic H5R object reference code */
+ test_reference_params(); /* Test for correct parameter checking */
+ test_reference_obj(); /* Test basic H5R object reference code */
- /* Loop through all the combinations of low/high version bounds */
+ /* Loop through all the combinations of low/high version bounds */
for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
@@ -1866,10 +1866,10 @@ test_reference(void)
} /* end high bound */
} /* end low bound */
- test_reference_obj_deleted(); /* Test H5R object reference code for deleted objects */
- test_reference_group(); /* Test operations on dereferenced groups */
+ test_reference_obj_deleted(); /* Test H5R object reference code for deleted objects */
+ test_reference_group(); /* Test operations on dereferenced groups */
#ifndef H5_NO_DEPRECATED_SYMBOLS
- test_reference_compat(); /* Test operations with old API routines */
+ test_reference_compat(); /* Test operations with old API routines */
#endif /* H5_NO_DEPRECATED_SYMBOLS */
} /* test_reference() */
diff --git a/test/tselect.c b/test/tselect.c
index 3c93e7a..90e7508 100644
--- a/test/tselect.c
+++ b/test/tselect.c
@@ -157,6 +157,12 @@
#define SPACERE5_DIM3 12
#define SPACERE5_DIM4 8
+/* Information for Space update diminfo test */
+#define SPACEUD1_DIM0 20
+#define SPACEUD3_DIM0 9
+#define SPACEUD3_DIM1 12
+#define SPACEUD3_DIM2 13
+
/* #defines for shape same / different rank tests */
#define SS_DR_MAX_RANK 5
@@ -167,6 +173,9 @@
#define SPACE13_DIM3 50
#define SPACE13_NPOINTS 4
+/* Information for testing selection iterators */
+#define SEL_ITER_MAX_SEQ 256
+
/* Location comparison function */
static int compare_size_t(const void *s1, const void *s2);
@@ -1308,14 +1317,8 @@ test_select_hyper_contig(hid_t dset_type, hid_t xfer_plist)
CHECK(ret, FAIL, "H5Dread");
/* Compare data read with data written out */
- if(HDmemcmp(rbuf, wbuf, sizeof(uint16_t) * 30 * 12)) {
+ if(HDmemcmp(rbuf, wbuf, sizeof(uint16_t) * 30 * 12))
TestErrPrintf("hyperslab values don't match! Line=%d\n",__LINE__);
-#ifdef QAK
- for(i=0, tbuf=wbuf; i<12; i++)
- for(j=0; j<30; j++)
- printf("i=%d, j=%d, *wbuf=%u, *rbuf=%u\n",i,j,(unsigned)*(wbuf+i*30+j),(unsigned)*(rbuf+i*30+j));
-#endif /* QAK */
- } /* end if */
/* Close memory dataspace */
ret = H5Sclose(sid2);
@@ -1432,14 +1435,8 @@ test_select_hyper_contig2(hid_t dset_type, hid_t xfer_plist)
CHECK(ret, FAIL, "H5Dread");
/* Compare data read with data written out */
- if(HDmemcmp(rbuf,wbuf,sizeof(uint16_t)*2*SPACE8_DIM3*SPACE8_DIM2*SPACE8_DIM1)) {
+ if(HDmemcmp(rbuf,wbuf,sizeof(uint16_t)*2*SPACE8_DIM3*SPACE8_DIM2*SPACE8_DIM1))
TestErrPrintf("Error: hyperslab values don't match!\n");
-#ifdef QAK
- for(i=0, tbuf=wbuf; i<12; i++)
- for(j=0; j<30; j++)
- printf("i=%d, j=%d, *wbuf=%u, *rbuf=%u\n",i,j,(unsigned)*(wbuf+i*30+j),(unsigned)*(rbuf+i*30+j));
-#endif /* QAK */
- } /* end if */
/* Close memory dataspace */
ret = H5Sclose(sid2);
@@ -3537,13 +3534,13 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_
/****************************************************************
**
-** test_select_hyper_checker_board_dr(): Test H5S (dataspace)
-** selection code with checkerboard source and target having
+** test_select_hyper_checker_board_dr(): Test H5S (dataspace)
+** selection code with checkerboard source and target having
** different ranks but the same shape. We have already
-** tested H5S_shape_same in isolation, so now we try to do
+** tested H5S_shape_same in isolation, so now we try to do
** I/O.
**
-** This is just an initial smoke check, so we will work
+** This is just an initial smoke check, so we will work
** with a slice through a cube only.
**
****************************************************************/
@@ -3743,15 +3740,8 @@ test_select_hyper_copy(void)
CHECK(ret, FAIL, "H5Dread");
/* Compare data read with data written out */
- if(HDmemcmp(rbuf,rbuf2,sizeof(uint16_t)*SPACE3_DIM1*SPACE3_DIM2)) {
+ if(HDmemcmp(rbuf,rbuf2,sizeof(uint16_t)*SPACE3_DIM1*SPACE3_DIM2))
TestErrPrintf("hyperslab values don't match! Line=%d\n",__LINE__);
-#ifdef QAK
- for(i=0; i<SPACE3_DIM1; i++)
- for(j=0; j<SPACE3_DIM2; j++)
- if((unsigned)*(rbuf+i*SPACE3_DIM2+j)!=(unsigned)*(rbuf2+i*SPACE3_DIM2+j))
- printf("i=%d, j=%d, *rbuf=%u, *rbuf2=%u\n",i,j,(unsigned)*(rbuf+i*SPACE3_DIM2+j),(unsigned)*(rbuf2+i*SPACE3_DIM2+j));
-#endif /* QAK */
- } /* end if */
/* Close memory dataspace */
ret = H5Sclose(sid2);
@@ -5220,7 +5210,7 @@ test_select_hyper_union_3d(void)
tmp2_space = H5Scombine_select(sid2,H5S_SELECT_OR,tmp_space);
CHECK(tmp2_space, FAIL, "H5Scombin_select");
- npoints = H5Sget_select_npoints(tmp2_space);
+ npoints = (hsize_t)H5Sget_select_npoints(tmp2_space);
VERIFY(npoints, 15*26, "H5Sget_select_npoints");
/* Create a dataset */
@@ -5902,42 +5892,29 @@ test_select_hyper_union_random_5d(hid_t read_plist)
CHECK(sid2, FAIL, "H5Screate_simple");
/* Get initial random # seed */
- seed=(unsigned)time(NULL)+(unsigned)clock();
+ seed = (unsigned)HDtime(NULL) + (unsigned)HDclock();
/* Crunch through a bunch of random hyperslab reads from the file dataset */
for(test_num=0; test_num<NRAND_HYPER; test_num++) {
/* Save random # seed for later use */
/* (Used in case of errors, to regenerate the hyperslab sequence) */
-#ifndef QAK
- seed+=(unsigned)clock();
-#else /* QAK */
- seed=987909620;
-#endif /* QAK */
+ seed += (unsigned)HDclock();
HDsrandom(seed);
-#ifdef QAK
-printf("test_num=%d, seed=%u\n",test_num,seed);
-#endif /* QAK */
-#ifndef QAK
for(i=0; i<NHYPERSLABS; i++) {
-#else /* QAK */
- for(i=0; i<2; i++) {
-#endif /* QAK */
-#ifdef QAK
-printf("hyperslab=%d\n",i);
-#endif /* QAK */
/* Select random hyperslab location & size for selection */
for(j=0; j<SPACE5_RANK; j++) {
start[j] = ((hsize_t)HDrandom() % dims1[j]);
count[j] = (((hsize_t)HDrandom() % (dims1[j] - start[j])) + 1);
-#ifdef QAK
-printf("start[%d]=%d, count[%d]=%d (end[%d]=%d)\n",j,(int)start[j],j,(int)count[j],j,(int)(start[j]+count[j]-1));
-#endif /* QAK */
} /* end for */
/* Select hyperslab */
ret = H5Sselect_hyperslab(sid1, (i == 0 ? H5S_SELECT_SET : H5S_SELECT_OR), start, NULL, count, NULL);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
+ if(ret < 0) {
+ TestErrPrintf("Random hyperslabs for seed %u failed!\n", seed);
+ break;
+ } /* end if */
} /* end for */
/* Get the number of elements selected */
@@ -5953,49 +5930,21 @@ printf("start[%d]=%d, count[%d]=%d (end[%d]=%d)\n",j,(int)start[j],j,(int)count[
npoints2 = H5Sget_select_npoints(sid2);
VERIFY(npoints, npoints2, "H5Sget_select_npoints");
-#ifdef QAK
-printf("random I/O, before H5Dread(), npoints=%lu\n",(unsigned long)npoints);
-{
- hsize_t blocks[128][2][SPACE5_RANK];
- hssize_t nblocks;
- int k;
-
- nblocks=H5Sget_select_hyper_nblocks(sid1);
- printf("nblocks=%d\n",(int)nblocks);
- H5Sget_select_hyper_blocklist(sid1,0,nblocks,blocks);
- for(j=0; j<nblocks; j++) {
- printf("Block #%d, start = {",j);
- for(k=0; k<SPACE5_RANK; k++) {
- printf("%d",blocks[j][0][k]);
- if(k<(SPACE5_RANK-1))
- printf(", ");
- else
- printf("}, end = {");
- } /* end for */
- for(k=0; k<SPACE5_RANK; k++) {
- printf("%d",blocks[j][1][k]);
- if(k<(SPACE5_RANK-1))
- printf(", ");
- else
- printf("}\n");
- } /* end for */
- } /* end for */
-}
-#endif /* QAK */
/* Read selection from disk */
ret=H5Dread(dataset,H5T_NATIVE_INT,sid2,sid1,read_plist,rbuf);
CHECK(ret, FAIL, "H5Dread");
-#ifdef QAK
-printf("random I/O, after H5Dread()\n");
-#endif /* QAK */
+ if(ret < 0) {
+ TestErrPrintf("Random hyperslabs for seed %u failed!\n", seed);
+ break;
+ } /* end if */
/* Compare data read with data written out */
tbuf=rbuf;
ret = H5Diterate(wbuf,H5T_NATIVE_INT,sid1,test_select_hyper_iter2,&tbuf);
- if(ret<0) {
- TestErrPrintf("Random hyperslabs for seed %u failed!\n",seed);
+ if(ret < 0) {
+ TestErrPrintf("Random hyperslabs for seed %u failed!\n", seed);
break;
- }
+ } /* end if */
/* Set the read buffer back to all zeroes */
HDmemset(rbuf, 0, (size_t)SPACE6_DIM1);
@@ -6282,9 +6231,6 @@ test_select_point_chunk(void)
herr_t ret; /* Generic return value */
unsigned *data_out; /* output buffer */
-#ifdef LATER
- unsigned *tmpdata_out; /* output buffer */
-#endif /* LATER */
hsize_t start[SPACE7_RANK]; /* hyperslab offset */
hsize_t count[SPACE7_RANK]; /* size of the hyperslab */
@@ -8155,53 +8101,53 @@ test_shape_same(void)
/* Compare "all" selection to all the selections created */
/* Compare against itself */
- check=H5S_select_shape_same_test(all_sid,all_sid);
+ check = H5S_select_shape_same_test(all_sid,all_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
/* Compare against copy of itself */
tmp_sid=H5Scopy(all_sid);
CHECK(tmp_sid, FAIL, "H5Scopy");
- check=H5S_select_shape_same_test(all_sid,tmp_sid);
+ check = H5S_select_shape_same_test(all_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
CHECK(ret, FAIL, "H5Sclose");
/* Compare against "none" selection */
- check=H5S_select_shape_same_test(all_sid,none_sid);
+ check = H5S_select_shape_same_test(all_sid,none_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against single point selection */
- check=H5S_select_shape_same_test(all_sid,single_pt_sid);
+ check = H5S_select_shape_same_test(all_sid,single_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against multiple point selection */
- check=H5S_select_shape_same_test(all_sid,mult_pt_sid);
+ check = H5S_select_shape_same_test(all_sid,mult_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "plain" single hyperslab selection */
- check=H5S_select_shape_same_test(all_sid,single_hyper_sid);
+ check = H5S_select_shape_same_test(all_sid,single_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "all" single hyperslab selection */
- check=H5S_select_shape_same_test(all_sid,single_hyper_all_sid);
+ check = H5S_select_shape_same_test(all_sid,single_hyper_all_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
/* Compare against "single point" single hyperslab selection */
- check=H5S_select_shape_same_test(all_sid,single_hyper_pt_sid);
+ check = H5S_select_shape_same_test(all_sid,single_hyper_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against regular, strided hyperslab selection */
- check=H5S_select_shape_same_test(all_sid,regular_hyper_sid);
+ check = H5S_select_shape_same_test(all_sid,regular_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against irregular hyperslab selection */
- check=H5S_select_shape_same_test(all_sid,irreg_hyper_sid);
+ check = H5S_select_shape_same_test(all_sid,irreg_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "no" hyperslab selection */
- check=H5S_select_shape_same_test(all_sid,none_hyper_sid);
+ check = H5S_select_shape_same_test(all_sid,none_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against scalar "all" hyperslab selection */
@@ -8214,53 +8160,53 @@ test_shape_same(void)
/* Compare "none" selection to all the selections created */
/* Compare against itself */
- check=H5S_select_shape_same_test(none_sid,none_sid);
+ check = H5S_select_shape_same_test(none_sid,none_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
/* Compare against copy of itself */
- tmp_sid=H5Scopy(none_sid);
+ tmp_sid = H5Scopy(none_sid);
CHECK(tmp_sid, FAIL, "H5Scopy");
- check=H5S_select_shape_same_test(none_sid,tmp_sid);
+ check = H5S_select_shape_same_test(none_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
CHECK(ret, FAIL, "H5Sclose");
/* Compare against "all" selection */
- check=H5S_select_shape_same_test(none_sid,all_sid);
+ check = H5S_select_shape_same_test(none_sid,all_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against single point selection */
- check=H5S_select_shape_same_test(none_sid,single_pt_sid);
+ check = H5S_select_shape_same_test(none_sid,single_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against multiple point selection */
- check=H5S_select_shape_same_test(none_sid,mult_pt_sid);
+ check = H5S_select_shape_same_test(none_sid,mult_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "plain" single hyperslab selection */
- check=H5S_select_shape_same_test(none_sid,single_hyper_sid);
+ check = H5S_select_shape_same_test(none_sid,single_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "all" single hyperslab selection */
- check=H5S_select_shape_same_test(none_sid,single_hyper_all_sid);
+ check = H5S_select_shape_same_test(none_sid,single_hyper_all_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "single point" single hyperslab selection */
- check=H5S_select_shape_same_test(none_sid,single_hyper_pt_sid);
+ check = H5S_select_shape_same_test(none_sid,single_hyper_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against regular, strided hyperslab selection */
- check=H5S_select_shape_same_test(none_sid,regular_hyper_sid);
+ check = H5S_select_shape_same_test(none_sid,regular_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against irregular hyperslab selection */
- check=H5S_select_shape_same_test(none_sid,irreg_hyper_sid);
+ check = H5S_select_shape_same_test(none_sid,irreg_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "no" hyperslab selection */
- check=H5S_select_shape_same_test(none_sid,none_hyper_sid);
+ check = H5S_select_shape_same_test(none_sid,none_hyper_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
/* Compare against scalar "all" hyperslab selection */
@@ -8273,49 +8219,49 @@ test_shape_same(void)
/* Compare single point selection to all the selections created */
/* Compare against itself */
- check=H5S_select_shape_same_test(single_pt_sid,single_pt_sid);
+ check = H5S_select_shape_same_test(single_pt_sid,single_pt_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
/* Compare against copy of itself */
- tmp_sid=H5Scopy(single_pt_sid);
+ tmp_sid = H5Scopy(single_pt_sid);
CHECK(tmp_sid, FAIL, "H5Scopy");
- check=H5S_select_shape_same_test(single_pt_sid,tmp_sid);
+ check = H5S_select_shape_same_test(single_pt_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
CHECK(ret, FAIL, "H5Sclose");
/* Compare against "all" selection */
- check=H5S_select_shape_same_test(single_pt_sid,all_sid);
+ check = H5S_select_shape_same_test(single_pt_sid,all_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "none" selection */
- check=H5S_select_shape_same_test(single_pt_sid,none_sid);
+ check = H5S_select_shape_same_test(single_pt_sid,none_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against multiple point selection */
- check=H5S_select_shape_same_test(single_pt_sid,mult_pt_sid);
+ check = H5S_select_shape_same_test(single_pt_sid,mult_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "plain" single hyperslab selection */
- check=H5S_select_shape_same_test(single_pt_sid,single_hyper_sid);
+ check = H5S_select_shape_same_test(single_pt_sid,single_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "all" single hyperslab selection */
- check=H5S_select_shape_same_test(single_pt_sid,single_hyper_all_sid);
+ check = H5S_select_shape_same_test(single_pt_sid,single_hyper_all_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "single point" single hyperslab selection */
- check=H5S_select_shape_same_test(single_pt_sid,single_hyper_pt_sid);
+ check = H5S_select_shape_same_test(single_pt_sid,single_hyper_pt_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
/* Compare against regular, strided hyperslab selection */
- check=H5S_select_shape_same_test(single_pt_sid,regular_hyper_sid);
+ check = H5S_select_shape_same_test(single_pt_sid,regular_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against irregular hyperslab selection */
- check=H5S_select_shape_same_test(single_pt_sid,irreg_hyper_sid);
+ check = H5S_select_shape_same_test(single_pt_sid,irreg_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "no" hyperslab selection */
@@ -8332,53 +8278,53 @@ test_shape_same(void)
/* Compare multiple point selection to all the selections created */
/* Compare against itself */
- check=H5S_select_shape_same_test(mult_pt_sid,mult_pt_sid);
+ check = H5S_select_shape_same_test(mult_pt_sid,mult_pt_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
/* Compare against copy of itself */
- tmp_sid=H5Scopy(mult_pt_sid);
+ tmp_sid = H5Scopy(mult_pt_sid);
CHECK(tmp_sid, FAIL, "H5Scopy");
- check=H5S_select_shape_same_test(mult_pt_sid,tmp_sid);
+ check = H5S_select_shape_same_test(mult_pt_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
CHECK(ret, FAIL, "H5Sclose");
/* Compare against "all" selection */
- check=H5S_select_shape_same_test(mult_pt_sid,all_sid);
+ check = H5S_select_shape_same_test(mult_pt_sid,all_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "none" selection */
- check=H5S_select_shape_same_test(mult_pt_sid,none_sid);
+ check = H5S_select_shape_same_test(mult_pt_sid,none_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against single point selection */
- check=H5S_select_shape_same_test(mult_pt_sid,single_pt_sid);
+ check = H5S_select_shape_same_test(mult_pt_sid,single_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "plain" single hyperslab selection */
- check=H5S_select_shape_same_test(mult_pt_sid,single_hyper_sid);
+ check = H5S_select_shape_same_test(mult_pt_sid,single_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "all" single hyperslab selection */
- check=H5S_select_shape_same_test(mult_pt_sid,single_hyper_all_sid);
+ check = H5S_select_shape_same_test(mult_pt_sid,single_hyper_all_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "single point" single hyperslab selection */
- check=H5S_select_shape_same_test(mult_pt_sid,single_hyper_pt_sid);
+ check = H5S_select_shape_same_test(mult_pt_sid,single_hyper_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against regular, strided hyperslab selection */
- check=H5S_select_shape_same_test(mult_pt_sid,regular_hyper_sid);
+ check = H5S_select_shape_same_test(mult_pt_sid,regular_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against irregular hyperslab selection */
- check=H5S_select_shape_same_test(mult_pt_sid,irreg_hyper_sid);
+ check = H5S_select_shape_same_test(mult_pt_sid,irreg_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "no" hyperslab selection */
- check=H5S_select_shape_same_test(mult_pt_sid,none_hyper_sid);
+ check = H5S_select_shape_same_test(mult_pt_sid,none_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against scalar "all" hyperslab selection */
@@ -8391,45 +8337,45 @@ test_shape_same(void)
/* Compare single "normal" hyperslab selection to all the selections created */
/* Compare against itself */
- check=H5S_select_shape_same_test(single_hyper_sid,single_hyper_sid);
+ check = H5S_select_shape_same_test(single_hyper_sid,single_hyper_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
/* Compare against copy of itself */
- tmp_sid=H5Scopy(single_hyper_sid);
+ tmp_sid = H5Scopy(single_hyper_sid);
CHECK(tmp_sid, FAIL, "H5Scopy");
- check=H5S_select_shape_same_test(single_hyper_sid,tmp_sid);
+ check = H5S_select_shape_same_test(single_hyper_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
CHECK(ret, FAIL, "H5Sclose");
/* Compare against "all" selection */
- check=H5S_select_shape_same_test(single_hyper_sid,all_sid);
+ check = H5S_select_shape_same_test(single_hyper_sid,all_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "none" selection */
- check=H5S_select_shape_same_test(single_hyper_sid,none_sid);
+ check = H5S_select_shape_same_test(single_hyper_sid,none_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against single point selection */
- check=H5S_select_shape_same_test(single_hyper_sid,single_pt_sid);
+ check = H5S_select_shape_same_test(single_hyper_sid,single_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against multiple point selection */
- check=H5S_select_shape_same_test(single_hyper_sid,mult_pt_sid);
+ check = H5S_select_shape_same_test(single_hyper_sid,mult_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "all" single hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_sid,single_hyper_all_sid);
+ check = H5S_select_shape_same_test(single_hyper_sid,single_hyper_all_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "single point" single hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_sid,single_hyper_pt_sid);
+ check = H5S_select_shape_same_test(single_hyper_sid,single_hyper_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against regular, strided hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_sid,regular_hyper_sid);
+ check = H5S_select_shape_same_test(single_hyper_sid,regular_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against irregular hyperslab selection */
@@ -8437,7 +8383,7 @@ test_shape_same(void)
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "no" hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_sid,none_hyper_sid);
+ check = H5S_select_shape_same_test(single_hyper_sid,none_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
#ifdef NOT_YET
@@ -8462,7 +8408,7 @@ test_shape_same(void)
} /* end for */
/* Compare against hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_sid,tmp_sid);
+ check = H5S_select_shape_same_test(single_hyper_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
@@ -8489,7 +8435,7 @@ test_shape_same(void)
} /* end for */
/* Compare against hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_sid,tmp_sid);
+ check = H5S_select_shape_same_test(single_hyper_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
@@ -8505,53 +8451,53 @@ test_shape_same(void)
/* Compare single "all" hyperslab selection to all the selections created */
/* Compare against itself */
- check=H5S_select_shape_same_test(single_hyper_all_sid,single_hyper_all_sid);
+ check = H5S_select_shape_same_test(single_hyper_all_sid,single_hyper_all_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
/* Compare against copy of itself */
- tmp_sid=H5Scopy(single_hyper_all_sid);
+ tmp_sid = H5Scopy(single_hyper_all_sid);
CHECK(tmp_sid, FAIL, "H5Scopy");
- check=H5S_select_shape_same_test(single_hyper_all_sid,tmp_sid);
+ check = H5S_select_shape_same_test(single_hyper_all_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
CHECK(ret, FAIL, "H5Sclose");
/* Compare against "all" selection */
- check=H5S_select_shape_same_test(single_hyper_all_sid,all_sid);
+ check = H5S_select_shape_same_test(single_hyper_all_sid,all_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
/* Compare against "none" selection */
- check=H5S_select_shape_same_test(single_hyper_all_sid,none_sid);
+ check = H5S_select_shape_same_test(single_hyper_all_sid,none_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against single point selection */
- check=H5S_select_shape_same_test(single_hyper_all_sid,single_pt_sid);
+ check = H5S_select_shape_same_test(single_hyper_all_sid,single_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against multiple point selection */
- check=H5S_select_shape_same_test(single_hyper_all_sid,mult_pt_sid);
+ check = H5S_select_shape_same_test(single_hyper_all_sid,mult_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "plain" single hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_all_sid,single_hyper_sid);
+ check = H5S_select_shape_same_test(single_hyper_all_sid,single_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "single point" single hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_all_sid,single_hyper_pt_sid);
+ check = H5S_select_shape_same_test(single_hyper_all_sid,single_hyper_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against regular, strided hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_all_sid,regular_hyper_sid);
+ check = H5S_select_shape_same_test(single_hyper_all_sid,regular_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against irregular hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_all_sid,irreg_hyper_sid);
+ check = H5S_select_shape_same_test(single_hyper_all_sid,irreg_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "no" hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_all_sid,none_hyper_sid);
+ check = H5S_select_shape_same_test(single_hyper_all_sid,none_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
#ifdef NOT_YET
@@ -8576,7 +8522,7 @@ test_shape_same(void)
} /* end for */
/* Compare against hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_all_sid,tmp_sid);
+ check = H5S_select_shape_same_test(single_hyper_all_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
@@ -8603,7 +8549,7 @@ test_shape_same(void)
} /* end for */
/* Compare against hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_all_sid,tmp_sid);
+ check = H5S_select_shape_same_test(single_hyper_all_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
@@ -8619,53 +8565,53 @@ test_shape_same(void)
/* Compare single "point" hyperslab selection to all the selections created */
/* Compare against itself */
- check=H5S_select_shape_same_test(single_hyper_pt_sid,single_hyper_pt_sid);
+ check = H5S_select_shape_same_test(single_hyper_pt_sid,single_hyper_pt_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
/* Compare against copy of itself */
- tmp_sid=H5Scopy(single_hyper_pt_sid);
+ tmp_sid = H5Scopy(single_hyper_pt_sid);
CHECK(tmp_sid, FAIL, "H5Scopy");
- check=H5S_select_shape_same_test(single_hyper_pt_sid,tmp_sid);
+ check = H5S_select_shape_same_test(single_hyper_pt_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
CHECK(ret, FAIL, "H5Sclose");
/* Compare against "all" selection */
- check=H5S_select_shape_same_test(single_hyper_pt_sid,all_sid);
+ check = H5S_select_shape_same_test(single_hyper_pt_sid,all_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "none" selection */
- check=H5S_select_shape_same_test(single_hyper_pt_sid,none_sid);
+ check = H5S_select_shape_same_test(single_hyper_pt_sid,none_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against single point selection */
- check=H5S_select_shape_same_test(single_hyper_pt_sid,single_pt_sid);
+ check = H5S_select_shape_same_test(single_hyper_pt_sid,single_pt_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
/* Compare against multiple point selection */
- check=H5S_select_shape_same_test(single_hyper_pt_sid,mult_pt_sid);
+ check = H5S_select_shape_same_test(single_hyper_pt_sid,mult_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "plain" single hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_pt_sid,single_hyper_sid);
+ check = H5S_select_shape_same_test(single_hyper_pt_sid,single_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "all" single hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_pt_sid,single_hyper_all_sid);
+ check = H5S_select_shape_same_test(single_hyper_pt_sid,single_hyper_all_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against regular, strided hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_pt_sid,regular_hyper_sid);
+ check = H5S_select_shape_same_test(single_hyper_pt_sid,regular_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against irregular hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_pt_sid,irreg_hyper_sid);
+ check = H5S_select_shape_same_test(single_hyper_pt_sid,irreg_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "no" hyperslab selection */
- check=H5S_select_shape_same_test(single_hyper_pt_sid,none_hyper_sid);
+ check = H5S_select_shape_same_test(single_hyper_pt_sid,none_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against scalar "all" hyperslab selection */
@@ -8678,53 +8624,53 @@ test_shape_same(void)
/* Compare regular, strided hyperslab selection to all the selections created */
/* Compare against itself */
- check=H5S_select_shape_same_test(regular_hyper_sid,regular_hyper_sid);
+ check = H5S_select_shape_same_test(regular_hyper_sid,regular_hyper_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
/* Compare against copy of itself */
- tmp_sid=H5Scopy(regular_hyper_sid);
+ tmp_sid = H5Scopy(regular_hyper_sid);
CHECK(tmp_sid, FAIL, "H5Scopy");
- check=H5S_select_shape_same_test(regular_hyper_sid,tmp_sid);
+ check = H5S_select_shape_same_test(regular_hyper_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
CHECK(ret, FAIL, "H5Sclose");
/* Compare against "all" selection */
- check=H5S_select_shape_same_test(regular_hyper_sid,all_sid);
+ check = H5S_select_shape_same_test(regular_hyper_sid,all_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "none" selection */
- check=H5S_select_shape_same_test(regular_hyper_sid,none_sid);
+ check = H5S_select_shape_same_test(regular_hyper_sid,none_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against single point selection */
- check=H5S_select_shape_same_test(regular_hyper_sid,single_pt_sid);
+ check = H5S_select_shape_same_test(regular_hyper_sid,single_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against multiple point selection */
- check=H5S_select_shape_same_test(regular_hyper_sid,mult_pt_sid);
+ check = H5S_select_shape_same_test(regular_hyper_sid,mult_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "plain" single hyperslab selection */
- check=H5S_select_shape_same_test(regular_hyper_sid,single_hyper_sid);
+ check = H5S_select_shape_same_test(regular_hyper_sid,single_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "all" single hyperslab selection */
- check=H5S_select_shape_same_test(regular_hyper_sid,single_hyper_all_sid);
+ check = H5S_select_shape_same_test(regular_hyper_sid,single_hyper_all_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "single point" single hyperslab selection */
- check=H5S_select_shape_same_test(regular_hyper_sid,single_hyper_pt_sid);
+ check = H5S_select_shape_same_test(regular_hyper_sid,single_hyper_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against irregular hyperslab selection */
- check=H5S_select_shape_same_test(regular_hyper_sid,irreg_hyper_sid);
+ check = H5S_select_shape_same_test(regular_hyper_sid,irreg_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "no" hyperslab selection */
- check=H5S_select_shape_same_test(regular_hyper_sid,none_hyper_sid);
+ check = H5S_select_shape_same_test(regular_hyper_sid,none_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Construct point selection which matches regular, strided hyperslab selection */
@@ -8733,8 +8679,8 @@ test_shape_same(void)
CHECK(tmp_sid, FAIL, "H5Screate_simple");
/* Select sequence of points for point selection */
- for(u=2; u<11; u+=2) {
- for(v=0; v<2; v++) {
+ for(u = 2; u < 11; u += 2) {
+ for(v = 0; v < 2; v++) {
coord2[v][0]=u; coord2[v][1]=(v*2)+2;
} /* end for */
ret = H5Sselect_elements(tmp_sid, H5S_SELECT_APPEND, (size_t)2, (const hsize_t *)coord2);
@@ -8742,7 +8688,7 @@ test_shape_same(void)
} /* end for */
/* Compare against hyperslab selection */
- check=H5S_select_shape_same_test(regular_hyper_sid,tmp_sid);
+ check = H5S_select_shape_same_test(regular_hyper_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
@@ -8758,17 +8704,17 @@ test_shape_same(void)
CHECK(ret, FAIL, "H5Sselect_none");
/* Select sequence of rows for hyperslab selection */
- for(u=2; u<11; u+=2) {
- start[0]=u; start[1]=3;
- stride[0]=1; stride[1]=2;
- count[0]=1; count[1]=2;
- block[0]=1; block[1]=1;
+ for(u = 2; u < 11; u += 2) {
+ start[0] = u; start[1] = 3;
+ stride[0] = 1; stride[1] = 2;
+ count[0] = 1; count[1] = 2;
+ block[0] = 1; block[1] = 1;
ret = H5Sselect_hyperslab(tmp_sid,H5S_SELECT_OR,start,stride,count,block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
} /* end for */
/* Compare against hyperslab selection */
- check=H5S_select_shape_same_test(regular_hyper_sid,tmp_sid);
+ check = H5S_select_shape_same_test(regular_hyper_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
@@ -8780,15 +8726,15 @@ test_shape_same(void)
CHECK(tmp_sid, FAIL, "H5Screate_simple");
/* Select regular, strided hyperslab selection at an offset */
- start[0]=1; start[1]=1;
- stride[0]=2; stride[1]=2;
- count[0]=5; count[1]=2;
- block[0]=1; block[1]=1;
+ start[0] = 1; start[1] = 1;
+ stride[0] = 2; stride[1] = 2;
+ count[0] = 5; count[1] = 2;
+ block[0] = 1; block[1] = 1;
ret = H5Sselect_hyperslab(tmp_sid,H5S_SELECT_SET,start,stride,count,block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* Compare against hyperslab selection */
- check=H5S_select_shape_same_test(regular_hyper_sid,tmp_sid);
+ check = H5S_select_shape_same_test(regular_hyper_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
@@ -8804,53 +8750,53 @@ test_shape_same(void)
/* Compare irregular hyperslab selection to all the selections created */
/* Compare against itself */
- check=H5S_select_shape_same_test(irreg_hyper_sid,irreg_hyper_sid);
+ check = H5S_select_shape_same_test(irreg_hyper_sid,irreg_hyper_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
/* Compare against copy of itself */
- tmp_sid=H5Scopy(irreg_hyper_sid);
+ tmp_sid = H5Scopy(irreg_hyper_sid);
CHECK(tmp_sid, FAIL, "H5Scopy");
- check=H5S_select_shape_same_test(irreg_hyper_sid,tmp_sid);
+ check = H5S_select_shape_same_test(irreg_hyper_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
CHECK(ret, FAIL, "H5Sclose");
/* Compare against "all" selection */
- check=H5S_select_shape_same_test(irreg_hyper_sid,all_sid);
+ check = H5S_select_shape_same_test(irreg_hyper_sid,all_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "none" selection */
- check=H5S_select_shape_same_test(irreg_hyper_sid,none_sid);
+ check = H5S_select_shape_same_test(irreg_hyper_sid,none_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against single point selection */
- check=H5S_select_shape_same_test(irreg_hyper_sid,single_pt_sid);
+ check = H5S_select_shape_same_test(irreg_hyper_sid,single_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against multiple point selection */
- check=H5S_select_shape_same_test(irreg_hyper_sid,mult_pt_sid);
+ check = H5S_select_shape_same_test(irreg_hyper_sid,mult_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "plain" single hyperslab selection */
- check=H5S_select_shape_same_test(irreg_hyper_sid,single_hyper_sid);
+ check = H5S_select_shape_same_test(irreg_hyper_sid,single_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "all" single hyperslab selection */
- check=H5S_select_shape_same_test(irreg_hyper_sid,single_hyper_all_sid);
+ check = H5S_select_shape_same_test(irreg_hyper_sid,single_hyper_all_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "single point" single hyperslab selection */
- check=H5S_select_shape_same_test(irreg_hyper_sid,single_hyper_pt_sid);
+ check = H5S_select_shape_same_test(irreg_hyper_sid,single_hyper_pt_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against regular, strided hyperslab selection */
- check=H5S_select_shape_same_test(irreg_hyper_sid,regular_hyper_sid);
+ check = H5S_select_shape_same_test(irreg_hyper_sid,regular_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Compare against "no" hyperslab selection */
- check=H5S_select_shape_same_test(irreg_hyper_sid,none_hyper_sid);
+ check = H5S_select_shape_same_test(irreg_hyper_sid,none_hyper_sid);
VERIFY(check, FALSE, "H5S_select_shape_same_test");
/* Construct hyperslab selection which matches irregular hyperslab selection */
@@ -8876,7 +8822,7 @@ test_shape_same(void)
} /* end for */
/* Compare against hyperslab selection */
- check=H5S_select_shape_same_test(irreg_hyper_sid,tmp_sid);
+ check = H5S_select_shape_same_test(irreg_hyper_sid,tmp_sid);
VERIFY(check, TRUE, "H5S_select_shape_same_test");
ret = H5Sclose(tmp_sid);
@@ -9042,27 +8988,27 @@ test_shape_same(void)
/****************************************************************
**
-** test_shape_same_dr__smoke_check_1():
+** test_shape_same_dr__smoke_check_1():
**
-** Create a square, 2 D data space (10 X 10), and select
+** Create a square, 2 D data space (10 X 10), and select
** all of it.
**
-** Similarly, create nine, 3 D data spaces (10 X 10 X 10),
-** and select (10 X 10 X 1) hyper slabs in each, three with
-** the slab parallel to the xy plane, three parallel to the
+** Similarly, create nine, 3 D data spaces (10 X 10 X 10),
+** and select (10 X 10 X 1) hyper slabs in each, three with
+** the slab parallel to the xy plane, three parallel to the
** xz plane, and three parallel to the yz plane.
**
-** Assuming that z is the fastest changing dimension,
-** H5S_select_shape_same() should return TRUE when comparing
-** the full 2 D space against any hyperslab parallel to the
-** yz plane in the 3 D space, and FALSE when comparing the
+** Assuming that z is the fastest changing dimension,
+** H5S_select_shape_same() should return TRUE when comparing
+** the full 2 D space against any hyperslab parallel to the
+** yz plane in the 3 D space, and FALSE when comparing the
** full 2 D space against the other two hyper slabs.
**
-** Also create two additional 3 D data spaces (10 X 10 X 10),
-** and select a (10 X 10 X 2) hyper slab parallel to the yz
-** axis in one of them, and two parallel (10 X 10 X 1) hyper
-** slabs parallel to the yz axis in the other.
-** H5S_select_shape_same() should return FALSE when comparing
+** Also create two additional 3 D data spaces (10 X 10 X 10),
+** and select a (10 X 10 X 2) hyper slab parallel to the yz
+** axis in one of them, and two parallel (10 X 10 X 1) hyper
+** slabs parallel to the yz axis in the other.
+** H5S_select_shape_same() should return FALSE when comparing
** each to the 2 D selection.
**
****************************************************************/
@@ -9333,9 +9279,9 @@ test_shape_same_dr__smoke_check_1(void)
/****************************************************************
**
-** test_shape_same_dr__smoke_check_2():
+** test_shape_same_dr__smoke_check_2():
**
-** Create a square, 2 D data space (10 X 10), and select
+** Create a square, 2 D data space (10 X 10), and select
** a "checker board" hyper slab as follows:
**
** * * - - * * - - * *
@@ -9349,27 +9295,27 @@ test_shape_same_dr__smoke_check_1(void)
** * * - - * * - - * *
** * * - - * * - - * *
**
-** where asterisks indicate selected elements, and dashes
+** where asterisks indicate selected elements, and dashes
** indicate unselected elements.
**
-** Similarly, create nine, 3 D data spaces (10 X 10 X 10),
-** and select similar (10 X 10 X 1) checker board hyper
-** slabs in each, three with the slab parallel to the xy
-** plane, three parallel to the xz plane, and three parallel
+** Similarly, create nine, 3 D data spaces (10 X 10 X 10),
+** and select similar (10 X 10 X 1) checker board hyper
+** slabs in each, three with the slab parallel to the xy
+** plane, three parallel to the xz plane, and three parallel
** to the yz plane.
**
-** Assuming that z is the fastest changing dimension,
-** H5S_select_shape_same() should return TRUE when comparing
-** the 2 D space checker board selection against a checker
-** board hyperslab parallel to the yz plane in the 3 D
-** space, and FALSE when comparing the 2 D checkerboard
-** selection against two hyper slabs parallel to the xy
+** Assuming that z is the fastest changing dimension,
+** H5S_select_shape_same() should return TRUE when comparing
+** the 2 D space checker board selection against a checker
+** board hyperslab parallel to the yz plane in the 3 D
+** space, and FALSE when comparing the 2 D checkerboard
+** selection against two hyper slabs parallel to the xy
** or xz planes.
**
-** Also create an additional 3 D data spaces (10 X 10 X 10),
-** and select a checker board parallel with the yz axis,
-** save with some squares being on different planes.
-** H5S_select_shape_same() should return FALSE when
+** Also create an additional 3 D data spaces (10 X 10 X 10),
+** and select a checker board parallel with the yz axis,
+** save with some squares being on different planes.
+** H5S_select_shape_same() should return FALSE when
** comparing this selection to the 2 D selection.
**
****************************************************************/
@@ -9652,7 +9598,7 @@ test_shape_same_dr__smoke_check_2(void)
start[0] = 4;
/* This test gets the right answer, but it fails the shape same
- * test in an unexpected point. Bring this up with Quincey, as
+ * test in an unexpected point. Bring this up with Quincey, as
* the oddness looks like it is not related to my code.
* -- JRM
*/
@@ -9741,9 +9687,9 @@ test_shape_same_dr__smoke_check_2(void)
/****************************************************************
**
-** test_shape_same_dr__smoke_check_3():
+** test_shape_same_dr__smoke_check_3():
**
-** Create a square, 2 D data space (10 X 10), and select an
+** Create a square, 2 D data space (10 X 10), and select an
** irregular hyper slab as follows:
**
** y
@@ -9759,22 +9705,22 @@ test_shape_same_dr__smoke_check_2(void)
** 0 - - - - - - - - - -
** 0 1 2 3 4 5 6 7 8 9 x
**
-** where asterisks indicate selected elements, and dashes
+** where asterisks indicate selected elements, and dashes
** indicate unselected elements.
**
-** Similarly, create nine, 3 D data spaces (10 X 10 X 10),
-** and select similar irregular hyper slabs in each, three
-** with the slab parallel to the xy plane, three parallel
-** to the xz plane, and three parallel to the yz plane.
-** Further, translate the irregular slab in 2/3rds of the
+** Similarly, create nine, 3 D data spaces (10 X 10 X 10),
+** and select similar irregular hyper slabs in each, three
+** with the slab parallel to the xy plane, three parallel
+** to the xz plane, and three parallel to the yz plane.
+** Further, translate the irregular slab in 2/3rds of the
** cases.
**
-** Assuming that z is the fastest changing dimension,
-** H5S_select_shape_same() should return TRUE when
-** comparing the 2 D irregular hyperslab selection
-** against the irregular hyperslab selections parallel
-** to the yz plane in the 3 D space, and FALSE when
-** comparing it against the irregular hyper slabs
+** Assuming that z is the fastest changing dimension,
+** H5S_select_shape_same() should return TRUE when
+** comparing the 2 D irregular hyperslab selection
+** against the irregular hyperslab selections parallel
+** to the yz plane in the 3 D space, and FALSE when
+** comparing it against the irregular hyper slabs
** selections parallel to the xy or xz planes.
**
****************************************************************/
@@ -10258,9 +10204,9 @@ test_shape_same_dr__smoke_check_3(void)
/****************************************************************
**
-** test_shape_same_dr__smoke_check_4():
+** test_shape_same_dr__smoke_check_4():
**
-** Create a square, 2 D data space (10 X 10), and select
+** Create a square, 2 D data space (10 X 10), and select
** the entire space.
**
** Similarly, create 3 D and 4 D data spaces:
@@ -10281,7 +10227,7 @@ test_shape_same_dr__smoke_check_3(void)
** And select these entire spaces as well.
**
** Compare the 2 D space against all the other spaces
-** with H5S_select_shape_same(). The (1 X 10 X 10) &
+** with H5S_select_shape_same(). The (1 X 10 X 10) &
** (1 X 1 X 10 X 10) should return TRUE. All others
** should return FALSE.
**
@@ -10478,12 +10424,12 @@ test_shape_same_dr__smoke_check_4(void)
/****************************************************************
**
** test_shape_same_dr__full_space_vs_slice(): Tests selection
-** of a full n-cube data space vs an n-dimensional slice of
-** of an m-cube (m > n) in a call to H5S_select_shape_same().
-** Note that this test does not require the n-cube and the
+** of a full n-cube data space vs an n-dimensional slice of
+** of an m-cube (m > n) in a call to H5S_select_shape_same().
+** Note that this test does not require the n-cube and the
** n-dimensional slice to have the same rank (although
-** H5S_select_shape_same() should always return FALSE if
-** they don't).
+** H5S_select_shape_same() should always return FALSE if
+** they don't).
**
** Per Quincey's suggestion, only test up to 5 dimensional
** spaces.
@@ -10499,7 +10445,7 @@ test_shape_same_dr__full_space_vs_slice(int test_num,
hbool_t expected_result)
{
char test_desc_0[128];
- char test_desc_1[128];
+ char test_desc_1[256];
int i;
hid_t n_cube_0_sid; /* the fully selected hyper cube */
hid_t n_cube_1_sid; /* the hyper cube in which a slice is selected */
@@ -10520,16 +10466,16 @@ test_shape_same_dr__full_space_vs_slice(int test_num,
HDassert( large_rank <= SS_DR_MAX_RANK );
HDassert( 0 <= offset );
HDassert( offset < large_rank );
- HDassert( edge_size > 0 );
- HDassert( edge_size <= 1000 );
+ HDassert( edge_size > 0 );
+ HDassert( edge_size <= 1000 );
- sprintf(test_desc_0,
- "\tn-cube slice through m-cube (n <= m) test %d.\n",
+ sprintf(test_desc_0,
+ "\tn-cube slice through m-cube (n <= m) test %d.\n",
test_num);
MESSAGE(7, (test_desc_0));
/* This statement must be updated if SS_DR_MAX_RANK is changed */
- sprintf(test_desc_1,
+ sprintf(test_desc_1,
"\t\tranks: %d/%d offset: %d dim_selected: %d/%d/%d/%d/%d.\n",
small_rank, large_rank, offset,
(int)dim_selected[0],
@@ -10610,27 +10556,27 @@ test_shape_same_dr__full_space_vs_slice(int test_num,
/****************************************************************
**
-** test_shape_same_dr__run_full_space_vs_slice_tests():
+** test_shape_same_dr__run_full_space_vs_slice_tests():
**
** Run the est_shape_same_dr__full_space_vs_slice() test
** over a variety of ranks and offsets.
**
-** At present, we test H5S_select_shape_same() with
+** At present, we test H5S_select_shape_same() with
** fully selected 1, 2, 3, and 4 cubes as one parameter, and
** 1, 2, 3, and 4 dimensional slices through a n-cube of rank
-** no more than 5 (and at least the rank of the slice).
-** We stop at rank 5, as Quincey suggested that it would be
+** no more than 5 (and at least the rank of the slice).
+** We stop at rank 5, as Quincey suggested that it would be
** sufficient.
**
-** All the n-cubes will have lengths of the same size, so
+** All the n-cubes will have lengths of the same size, so
** H5S_select_shape_same() should return true iff:
**
-** 1) the rank for the fully selected n cube equals the
+** 1) the rank for the fully selected n cube equals the
** number of dimensions selected in the slice through the
** m-cube (m >= n).
**
** 2) The dimensions selected in the slice through the m-cube
-** are the dimesnions with the most quickly changing
+** are the dimesnions with the most quickly changing
** indices.
**
****************************************************************/
@@ -10736,7 +10682,7 @@ test_shape_same_dr__run_full_space_vs_slice_tests(void)
dim_selected,
expected_result
);
-
+
z++;
} while((z < 2) && (large_rank >= 1));
@@ -10759,15 +10705,15 @@ test_shape_same_dr__run_full_space_vs_slice_tests(void)
/****************************************************************
**
-** test_shape_same_dr__checkerboard(): Tests selection of a
-** "checker board" subset of a full n-cube data space vs
+** test_shape_same_dr__checkerboard(): Tests selection of a
+** "checker board" subset of a full n-cube data space vs
** a "checker board" n-dimensional slice of an m-cube (m > n).
-** in a call to H5S_select_shape_same().
+** in a call to H5S_select_shape_same().
**
-** Note that this test does not require the n-cube and the
+** Note that this test does not require the n-cube and the
** n-dimensional slice to have the same rank (although
-** H5S_select_shape_same() should always return FALSE if
-** they don't).
+** H5S_select_shape_same() should always return FALSE if
+** they don't).
**
** Per Quincey's suggestion, only test up to 5 dimensional
** spaces.
@@ -10784,14 +10730,14 @@ test_shape_same_dr__checkerboard(int test_num,
hbool_t expected_result)
{
char test_desc_0[128];
- char test_desc_1[128];
+ char test_desc_1[256];
int i;
int dims_selected = 0;
- hid_t n_cube_0_sid; /* the checker board selected
- * hyper cube
+ hid_t n_cube_0_sid; /* the checker board selected
+ * hyper cube
*/
- hid_t n_cube_1_sid; /* the hyper cube in which a
- * checkerboard slice is selected
+ hid_t n_cube_1_sid; /* the hyper cube in which a
+ * checkerboard slice is selected
*/
hsize_t dims[SS_DR_MAX_RANK];
hsize_t base_start[2];
@@ -10813,8 +10759,8 @@ test_shape_same_dr__checkerboard(int test_num,
HDassert( small_rank <= large_rank );
HDassert( large_rank <= SS_DR_MAX_RANK );
HDassert( 0 < checker_size );
- HDassert( checker_size <= edge_size );
- HDassert( edge_size <= 1000 );
+ HDassert( checker_size <= edge_size );
+ HDassert( edge_size <= 1000 );
HDassert( 0 <= offset );
HDassert( offset < (int)edge_size );
@@ -10825,13 +10771,13 @@ test_shape_same_dr__checkerboard(int test_num,
HDassert( dims_selected >= 0 );
HDassert( dims_selected <= large_rank );
- sprintf(test_desc_0,
- "\tcheckerboard n-cube slice through m-cube (n <= m) test %d.\n",
+ sprintf(test_desc_0,
+ "\tcheckerboard n-cube slice through m-cube (n <= m) test %d.\n",
test_num);
MESSAGE(7, (test_desc_0));
/* This statement must be updated if SS_DR_MAX_RANK is changed */
- sprintf(test_desc_1,
+ sprintf(test_desc_1,
"\tranks: %d/%d edge/chkr size: %d/%d offset: %d dim_selected: %d/%d/%d/%d/%d:%d.\n",
small_rank, large_rank,
(int)edge_size, (int)checker_size,
@@ -10871,17 +10817,17 @@ test_shape_same_dr__checkerboard(int test_num,
* * * - - * * - - * *
* * * - - * * - - * *
*
- * In both cases, asterisks indicate selected elements,
+ * In both cases, asterisks indicate selected elements,
* and dashes indicate unselected elements.
*
* 3-D and 4-D ascii art is somewhat painful, so I'll
* leave those selections to your imagination. :-)
*
* Note, that since the edge_size and checker_size are
- * parameters that are passed in, the selection need
+ * parameters that are passed in, the selection need
* not look exactly like the selection shown above.
- * At present, the function allows checker sizes that
- * are not even divisors of the edge size -- thus
+ * At present, the function allows checker sizes that
+ * are not even divisors of the edge size -- thus
* something like the following is also possible:
*
* * * * - - - * * * -
@@ -10895,14 +10841,14 @@ test_shape_same_dr__checkerboard(int test_num,
* * * * - - - * * * -
* - - - * * * - - - *
*
- * As the above pattern can't be selected in one
+ * As the above pattern can't be selected in one
* call to H5Sselect_hyperslab(), and since the
* values in the start, stride, count, and block
- * arrays will be repeated over all entries in
+ * arrays will be repeated over all entries in
* the selected space case, and over all selected
* dimensions in the selected hyperslab case, we
- * compute these values first and store them in
- * in the base_start, base_stride, base_count,
+ * compute these values first and store them in
+ * in the base_start, base_stride, base_count,
* and base_block arrays.
*/
@@ -10912,9 +10858,9 @@ test_shape_same_dr__checkerboard(int test_num,
base_stride[0] = 2 * checker_size;
base_stride[1] = 2 * checker_size;
- /* Note that the following computation depends on the C99
- * requirement that integer division discard any fraction
- * (truncation towards zero) to function correctly. As we
+ /* Note that the following computation depends on the C99
+ * requirement that integer division discard any fraction
+ * (truncation towards zero) to function correctly. As we
* now require C99, this shouldn't be a problem, but noting
* it may save us some pain if we are ever obliged to support
* pre-C99 compilers again.
@@ -10931,7 +10877,7 @@ test_shape_same_dr__checkerboard(int test_num,
base_block[0] = checker_size;
base_block[1] = checker_size;
- /* now setup start, stride, count, and block arrays for
+ /* now setup start, stride, count, and block arrays for
* the first call to H5Sselect_hyperslab().
*/
for(i = 0; i < SS_DR_MAX_RANK; i++) {
@@ -10945,10 +10891,10 @@ test_shape_same_dr__checkerboard(int test_num,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- /* if small_rank == 1, or if edge_size == checker_size, we
+ /* if small_rank == 1, or if edge_size == checker_size, we
* are done, as either there is no added dimension in which
* to place offset selected "checkers".
- *
+ *
* Otherwise, set up start, stride, count and block, and
* make the additional selection.
*/
@@ -10968,7 +10914,7 @@ test_shape_same_dr__checkerboard(int test_num,
/* Wierdness alert:
*
- * Some how, it seems that selections can extend beyond the
+ * Some how, it seems that selections can extend beyond the
* boundaries of the target data space -- hence the following
* code to manually clip the selection back to the data space
* proper.
@@ -10991,8 +10937,8 @@ test_shape_same_dr__checkerboard(int test_num,
/* Now select the checkerboard selection in the (possibly larger) n-cube.
- *
- * Since we have already calculated the base start, stride, count,
+ *
+ * Since we have already calculated the base start, stride, count,
* and block, re-use the values in setting up start, stride, count,
* and block.
*/
@@ -11036,10 +10982,10 @@ test_shape_same_dr__checkerboard(int test_num,
start_ptr, stride_ptr, count_ptr, block_ptr);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- /* As before, if the number of dimensions selected is less than or
- * equal to 1, or if edge_size == checker_size, we are done, as
- * either there is no added dimension in which to place offset selected
- * "checkers", or the hyperslab is completely occupied by one
+ /* As before, if the number of dimensions selected is less than or
+ * equal to 1, or if edge_size == checker_size, we are done, as
+ * either there is no added dimension in which to place offset selected
+ * "checkers", or the hyperslab is completely occupied by one
* "checker".
*
* Otherwise, set up start, stride, count and block, and
@@ -11069,7 +11015,7 @@ test_shape_same_dr__checkerboard(int test_num,
/* Wierdness alert:
*
- * Again, it seems that selections can extend beyond the
+ * Again, it seems that selections can extend beyond the
* boundaries of the target data space -- hence the following
* code to manually clip the selection back to the data space
* proper.
@@ -11102,23 +11048,23 @@ test_shape_same_dr__checkerboard(int test_num,
/****************************************************************
**
-** test_shape_same_dr__run_checkerboard_tests():
+** test_shape_same_dr__run_checkerboard_tests():
**
-** In this set of tests, we test H5S_select_shape_same()
-** with a "checkerboard" selection of 1, 2, 3, and 4 cubes as
-** one parameter, and 1, 2, 3, and 4 dimensional checkerboard
-** slices through a n-cube of rank no more than 5 (and at
-** least the rank of the slice).
+** In this set of tests, we test H5S_select_shape_same()
+** with a "checkerboard" selection of 1, 2, 3, and 4 cubes as
+** one parameter, and 1, 2, 3, and 4 dimensional checkerboard
+** slices through a n-cube of rank no more than 5 (and at
+** least the rank of the slice).
**
-** All the n-cubes will have lengths of the same size, so
+** All the n-cubes will have lengths of the same size, so
** H5S_select_shape_same() should return true iff:
**
-** 1) the rank of the n cube equals the number of dimensions
-** selected in the checker board slice through the m-cube
+** 1) the rank of the n cube equals the number of dimensions
+** selected in the checker board slice through the m-cube
** (m >= n).
**
-** 2) The dimensions selected in the checkerboard slice
-** through the m-cube are the dimensions with the most
+** 2) The dimensions selected in the checkerboard slice
+** through the m-cube are the dimensions with the most
** quickly changing indices.
**
****************************************************************/
@@ -11169,7 +11115,7 @@ test_shape_same_dr__run_checkerboard_tests(void)
dim_selected[4] = FALSE;
else
dim_selected[4] = TRUE;
-
+
/* compute the expected result: */
i = 0;
@@ -11373,17 +11319,17 @@ test_shape_same_dr__run_checkerboard_tests(void)
/****************************************************************
**
-** test_shape_same_dr__irregular():
+** test_shape_same_dr__irregular():
**
-** Tests selection of an "irregular" subset of a full
+** Tests selection of an "irregular" subset of a full
** n-cube data space vs an identical "irregular" subset
** of an n-dimensional slice of an m-cube (m > n).
-** in a call to H5S_select_shape_same().
+** in a call to H5S_select_shape_same().
**
-** Note that this test does not require the n-cube and the
+** Note that this test does not require the n-cube and the
** n-dimensional slice to have the same rank (although
-** H5S_select_shape_same() should always return FALSE if
-** they don't).
+** H5S_select_shape_same() should always return FALSE if
+** they don't).
**
****************************************************************/
static void
@@ -11396,7 +11342,7 @@ test_shape_same_dr__irregular(int test_num,
hbool_t expected_result)
{
char test_desc_0[128];
- char test_desc_1[128];
+ char test_desc_1[256];
int edge_size = 10;
int i;
int j;
@@ -11405,7 +11351,7 @@ test_shape_same_dr__irregular(int test_num,
hid_t n_cube_0_sid; /* the hyper cube containing
* an irregular selection
*/
- hid_t n_cube_1_sid; /* the hyper cube in which a
+ hid_t n_cube_1_sid; /* the hyper cube in which a
* slice contains an irregular
* selection.
*/
@@ -11441,7 +11387,7 @@ test_shape_same_dr__irregular(int test_num,
hsize_t clip_block[SS_DR_MAX_RANK] = {10, 10, 10, 10, 10};
- hsize_t *(starts[SS_DR_MAX_RANK]) =
+ hsize_t *(starts[SS_DR_MAX_RANK]) =
{start_0, start_1, start_2, start_3, start_4};
hsize_t *(strides[SS_DR_MAX_RANK]) =
{stride_0, stride_1, stride_2, stride_3, stride_4};
@@ -11464,8 +11410,8 @@ test_shape_same_dr__irregular(int test_num,
HDassert( 0 < small_rank );
HDassert( small_rank <= large_rank );
HDassert( large_rank <= SS_DR_MAX_RANK );
- HDassert( 9 <= edge_size );
- HDassert( edge_size <= 1000 );
+ HDassert( 9 <= edge_size );
+ HDassert( edge_size <= 1000 );
HDassert( 0 <= slice_offset );
HDassert( slice_offset < edge_size );
HDassert( -2 <= pattern_offset );
@@ -11478,16 +11424,16 @@ test_shape_same_dr__irregular(int test_num,
HDassert( dims_selected >= 0 );
HDassert( dims_selected <= large_rank );
- sprintf(test_desc_0,
- "\tirregular sub set of n-cube slice through m-cube (n <= m) test %d.\n",
+ sprintf(test_desc_0,
+ "\tirregular sub set of n-cube slice through m-cube (n <= m) test %d.\n",
test_num);
MESSAGE(7, (test_desc_0));
/* This statement must be updated if SS_DR_MAX_RANK is changed */
- sprintf(test_desc_1,
+ sprintf(test_desc_1,
"\tranks: %d/%d edge: %d s/p offset: %d/%d dim_selected: %d/%d/%d/%d/%d:%d.\n",
small_rank, large_rank,
- edge_size,
+ edge_size,
slice_offset, pattern_offset,
(int)dim_selected[0],
(int)dim_selected[1],
@@ -11506,11 +11452,11 @@ test_shape_same_dr__irregular(int test_num,
CHECK(n_cube_0_sid, FAIL, "H5Screate_simple");
/* Select an "irregular" pattern in the small n-cube. This
- * pattern can be though of a set of four 3 x 2 x 2 X 2
- * four dimensional prisims, each parallel to one of the
- * axies and none of them intersecting with the other.
+ * pattern can be though of a set of four 3 x 2 x 2 X 2
+ * four dimensional prisims, each parallel to one of the
+ * axies and none of them intersecting with the other.
*
- * In the lesser dimensional cases, this 4D pattern is
+ * In the lesser dimensional cases, this 4D pattern is
* projected onto the lower dimensional space.
*
* In the 1-D case, the projection of the pattern looks
@@ -11535,12 +11481,12 @@ test_shape_same_dr__irregular(int test_num,
* 0 - - - - - - - - - -
* 0 1 2 3 4 5 6 7 8 9 x
*
- * In both cases, asterisks indicate selected elements,
+ * In both cases, asterisks indicate selected elements,
* and dashes indicate unselected elements.
*
* Note that is this case, since the edge size is fixed,
- * the pattern does not change. However, we do use the
- * displacement parameter to allow it to be moved around
+ * the pattern does not change. However, we do use the
+ * displacement parameter to allow it to be moved around
* within the n-cube or hyper slab.
*/
@@ -11555,7 +11501,7 @@ test_shape_same_dr__irregular(int test_num,
CHECK(ret, FAIL, "H5Sselect_hyperslab");
} /* end for */
- /* finally, clip the selection to ensure that it lies fully
+ /* finally, clip the selection to ensure that it lies fully
* within the n-cube.
*/
ret = H5Sselect_hyperslab(n_cube_0_sid, H5S_SELECT_AND,
@@ -11594,8 +11540,8 @@ test_shape_same_dr__irregular(int test_num,
/* Now select the irregular selection in the (possibly larger) n-cube.
- *
- * Basic idea is to project the pattern used in the smaller n-cube
+ *
+ * Basic idea is to project the pattern used in the smaller n-cube
* onto the dimensions selected in the larger n-cube, with the displacement
* specified.
*/
@@ -11648,25 +11594,25 @@ test_shape_same_dr__irregular(int test_num,
/****************************************************************
**
-** test_shape_same_dr__run_irregular_tests():
+** test_shape_same_dr__run_irregular_tests():
**
-** In this set of tests, we test H5S_select_shape_same()
-** with an "irregular" subselection of 1, 2, 3, and 4 cubes as
-** one parameter, and irregular subselections of 1, 2, 3,
-** and 4 dimensional slices through a n-cube of rank no more
-** than 5 (and at least the rank of the slice) as the other.
-** Note that the "irregular" selection may be offset between
+** In this set of tests, we test H5S_select_shape_same()
+** with an "irregular" subselection of 1, 2, 3, and 4 cubes as
+** one parameter, and irregular subselections of 1, 2, 3,
+** and 4 dimensional slices through a n-cube of rank no more
+** than 5 (and at least the rank of the slice) as the other.
+** Note that the "irregular" selection may be offset between
** the n-cube and the slice.
**
** All the irregular selections will be identical (modulo rank)
** so H5S_select_shape_same() should return true iff:
**
-** 1) the rank of the n cube equals the number of dimensions
-** selected in the irregular slice through the m-cube
+** 1) the rank of the n cube equals the number of dimensions
+** selected in the irregular slice through the m-cube
** (m >= n).
**
-** 2) The dimensions selected in the irregular slice
-** through the m-cube are the dimensions with the most
+** 2) The dimensions selected in the irregular slice
+** through the m-cube are the dimensions with the most
** quickly changing indices.
**
****************************************************************/
@@ -11717,7 +11663,7 @@ test_shape_same_dr__run_irregular_tests(void)
dim_selected[4] = FALSE;
else
dim_selected[4] = TRUE;
-
+
/* compute the expected result: */
i = 0;
@@ -11863,8 +11809,8 @@ test_shape_same_dr__run_irregular_tests(void)
/****************************************************************
**
-** test_shape_same_dr(): Tests selections on dataspace with
-** different ranks, to verify that "shape same" routine
+** test_shape_same_dr(): Tests selections on dataspace with
+** different ranks, to verify that "shape same" routine
** is now handling this case correctly.
**
****************************************************************/
diff --git a/test/tsohm.c b/test/tsohm.c
index 93ba14f..4329514 100644
--- a/test/tsohm.c
+++ b/test/tsohm.c
@@ -11,13 +11,9 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/***********************************************************
-*
-* Test program: tsohm
-*
-* Test Shared Object Header Messages
-*
-*************************************************************/
+/*
+ * Purpose: Test Shared Object Header Messages
+ */
#include "testhdf5.h"
@@ -25,9 +21,9 @@
* This file needs to access private information from the H5F package.
* This file also needs to access the file testing code.
*/
-#define H5F_FRIEND /*suppress error about including H5Fpkg */
+#define H5F_FRIEND /* suppress error about including H5Fpkg */
#define H5F_TESTING
-#include "H5Fpkg.h" /* File access */
+#include "H5Fpkg.h" /* File access */
/* Default SOHM values */
#define DEF_NUM_INDEXES 0
@@ -178,14 +174,11 @@ static void test_sohm_extlink(void);
/****************************************************************
**
-** verify_fcpl_values(): Helper function for test_sohm_fcpl.
-** Verifies that the *_in and *_out parameters are equal.
+** verify_fcpl_values(): Verifies that FCPL is set as expected.
**
****************************************************************/
static void
-verify_fcpl_values(hid_t fcpl_id, const unsigned nindexes_expected,
- const unsigned *flags_expected, const unsigned *minsizes_expected,
- unsigned l2b, unsigned b2l)
+verify_fcpl_values(hid_t fcpl_id, const unsigned nindexes_expected, const unsigned *flags_expected, const unsigned *minsizes_expected, unsigned l2b, unsigned b2l)
{
unsigned nindexes_actual;
unsigned list_size;
@@ -197,6 +190,7 @@ verify_fcpl_values(hid_t fcpl_id, const unsigned nindexes_expected,
ret = H5Pget_shared_mesg_nindexes(fcpl_id, &nindexes_actual);
CHECK_I(ret, "H5Pget_shared_mesg_nindexes");
VERIFY(nindexes_actual, nindexes_expected, "H5Pget_shared_mesg_nindexes");
+
/* Index flags and minsizes */
for(x=0; x<nindexes_actual; ++x) {
unsigned flags_i;
@@ -223,11 +217,11 @@ verify_fcpl_values(hid_t fcpl_id, const unsigned nindexes_expected,
static void
test_sohm_fcpl(void)
{
- hid_t fid = -1;
- hid_t fcpl_id = -1;
- hid_t fcpl2_id = -1;
- unsigned x;
- herr_t ret; /* Generic return value */
+ hid_t fid = -1;
+ hid_t fcpl_id = -1;
+ hid_t fcpl2_id = -1;
+ unsigned x;
+ herr_t ret;
MESSAGE(5, ("Testing File Creation Properties for Shared Messages\n"));
@@ -320,9 +314,8 @@ test_sohm_fcpl(void)
CHECK_I(ret, "H5Fclose");
/* Actually, the list max can be exactly 1 greater than the
- * btree min, but no more. Also, the errors above shouldn't
- * have corrupted the fcpl, although we do need to reset the
- * second index that we changed above.
+ * btree min, but no more.
+ * Reset the second index.
*/
ret = H5Pset_shared_mesg_index(fcpl_id, 1, test_type_flags[1], 15);
CHECK_I(ret, "H5Pset_shared_mesg_index");
@@ -333,9 +326,10 @@ test_sohm_fcpl(void)
ret = H5Fclose(fid);
CHECK_I(ret, "H5Fclose");
- /* Test edge cases; H5O_SHMESG_MAX_NINDEXES and H5O_SHMESG_MAX_LIST_SIZE should be
- * valid values. Also, creating a file with uninitialized indexes
- * (indexes 3-5) should work.
+ /* Test edge cases:
+ * H5O_SHMESG_MAX_NINDEXES and H5O_SHMESG_MAX_LIST_SIZE should be valid
+ * values.
+ * Creating a file with uninitialized indexes should work. (TODO: not implemented?)
*/
ret = H5Pset_shared_mesg_nindexes(fcpl_id, H5O_SHMESG_MAX_NINDEXES);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
@@ -344,7 +338,6 @@ test_sohm_fcpl(void)
fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT);
CHECK_I(fid, "H5Fcreate");
-
/* Clean up */
ret = H5Pclose(fcpl_id);
CHECK_I(ret, "H5Pclose");
@@ -352,7 +345,6 @@ test_sohm_fcpl(void)
CHECK_I(ret, "H5Fclose");
} /* test_sohm_fcpl */
-
/****************************************************************
**
@@ -385,7 +377,6 @@ test_sohm_fcpl_errors(void)
verify_fcpl_values(fcpl_id, TEST_NUM_INDEXES, test_type_flags, test_minsizes, TEST_L2B, TEST_B2L);
- /* Test giving bogus values to H5P* functions */
H5E_BEGIN_TRY {
/* Trying to create too many indexes should fail */
ret = H5Pset_shared_mesg_nindexes(fcpl_id, H5O_SHMESG_MAX_NINDEXES + 1);
@@ -484,7 +475,7 @@ error:
H5Tclose(dtype1_id);
} H5E_END_TRY
return -1;
-} /* make_dtype_1 */
+} /* make_dtype1 */
/*-------------------------------------------------------------------------
@@ -587,12 +578,12 @@ error:
*
* Purpose: Creates object headers that use a large datatype message.
*
- * Set test_file_closing to 1 to add file closing and reopening
+ * Set test_file_closing to TRUE to add file closing and reopening
* whenever possible (to test that SOHMs are written correctly
* on disk and not just in memory).
*
- * Return: Success: file ID (may not be the same one passed in)
- * Failure: Negative
+ * Return: Success: file ID (may not be the same one passed in)
+ * Failure: H5I_INVALID_HID
*
* Programmer: James Laird
* Monday, April 10, 2006
@@ -600,13 +591,13 @@ error:
*-------------------------------------------------------------------------
*/
static hid_t
-size1_helper(hid_t file, const char *filename, hid_t fapl_id, int test_file_closing)
+size1_helper(hid_t file, const char *filename, hid_t fapl_id, hbool_t test_file_closing)
{
dtype1_struct wdata;
dtype1_struct rdata;
- hid_t dtype1_id = -1;
- hid_t space_id = -1;
- hid_t dset_id = -1;
+ hid_t dtype1_id = H5I_INVALID_HID;
+ hid_t space_id = H5I_INVALID_HID;
+ hid_t dset_id = H5I_INVALID_HID;
hsize_t dim1[1];
int x;
@@ -626,12 +617,12 @@ size1_helper(hid_t file, const char *filename, hid_t fapl_id, int test_file_clos
HDmemset(&rdata, 0, sizeof(rdata)); \
if (0 > H5Dread((dset_id), (dtype_id), H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata)) { \
H5_FAILED(); AT(); \
- printf("Can't read data\n"); \
+ HDprintf("Can't read data\n"); \
goto error; \
} \
if ((rdata.i1 != wdata.i1) || (rdata.i2 != wdata.i2) || HDstrcmp(rdata.str, wdata.str)) { \
H5_FAILED(); AT(); \
- printf("incorrect read data\n"); \
+ HDprintf("incorrect read data\n"); \
goto error; \
} \
} /* TSOHM_S1H_VERIFY_DATA() definition */
@@ -640,7 +631,7 @@ size1_helper(hid_t file, const char *filename, hid_t fapl_id, int test_file_clos
* local disks. Don't close and reopen if express testing is enabled.
*/
if(GetTestExpress() > 1)
- test_file_closing = 0;
+ test_file_closing = FALSE;
/* Intialize wdata */
HDmemset(&wdata, 0, sizeof(wdata));
@@ -658,17 +649,18 @@ size1_helper(hid_t file, const char *filename, hid_t fapl_id, int test_file_clos
/* Intialize rdata */
HDmemset(&rdata, 0, sizeof(rdata));
- if((dtype1_id = make_dtype_1()) < 0) TEST_ERROR
+ dtype1_id = make_dtype_1();
+ if(dtype1_id < 0) TEST_ERROR
- /* Create the dataspace and dataset */
dim1[0] = 1;
- if((space_id = H5Screate_simple(1, dim1, NULL)) < 0) TEST_ERROR
+ space_id = H5Screate_simple(1, dim1, NULL);
+ if(space_id < 0) TEST_ERROR
- if((dset_id = H5Dcreate2(file, DSETNAME[0], dtype1_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ dset_id = H5Dcreate2(file, DSETNAME[0], dtype1_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if(dset_id < 0) FAIL_STACK_ERROR
/* Test writing and reading */
if(H5Dwrite(dset_id, dtype1_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wdata) < 0) FAIL_STACK_ERROR
-
TSOHM_S1H_VERIFY_DATA(dset_id, dtype1_id)
if(H5Dclose(dset_id) < 0) FAIL_STACK_ERROR
@@ -702,7 +694,8 @@ size1_helper(hid_t file, const char *filename, hid_t fapl_id, int test_file_clos
* this increases the amount of space saved by sharing the datatype message
*/
for(x = 0; x < SOHM_HELPER_NUM_EX_DSETS; x++) {
- if((dset_id = H5Dcreate2(file, EXTRA_DSETNAME[x], dtype1_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ dset_id = H5Dcreate2(file, EXTRA_DSETNAME[x], dtype1_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if(dset_id < 0) TEST_ERROR
if(H5Dclose(dset_id) < 0) TEST_ERROR
if(test_file_closing)
@@ -721,6 +714,7 @@ size1_helper(hid_t file, const char *filename, hid_t fapl_id, int test_file_clos
if(H5Dclose(dset_id) < 0) TEST_ERROR
if(H5Tclose(dtype1_id) < 0) TEST_ERROR
+
return file;
error:
@@ -730,7 +724,8 @@ size1_helper(hid_t file, const char *filename, hid_t fapl_id, int test_file_clos
H5Dclose(dset_id);
H5Fclose(file);
} H5E_END_TRY
- return -1;
+
+ return H5I_INVALID_HID;
#undef TSOHM_S1H_VERIFY_DATA /* macro is exclusive to this function */
} /* size1_helper */
@@ -747,25 +742,30 @@ size1_helper(hid_t file, const char *filename, hid_t fapl_id, int test_file_clos
*----------------------------------------------------------------------------
*/
static h5_stat_size_t
-getsize_testsize1(const char *filename, hid_t fcpl_id, hid_t fapl_id, unsigned open_close, H5O_info_t *oinfo)
+getsize_testsize1(const char *filename, hid_t fcpl_id, hid_t fapl_id,
+ hbool_t test_file_closing, H5O_info_t *oinfo)
{
- hid_t file = -1;
+ hid_t fid = H5I_INVALID_HID;
herr_t ret;
- file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, fapl_id);
- CHECK_I(file, "H5Fcreate");
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl_id, fapl_id);
+ CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
- file = size1_helper(file, FILENAME, fapl_id, open_close);
- CHECK_I(file, "size1_helper");
+ /* If test_file_closing is TRUE, you will get back a different ID,
+ * which will need to be closed. The helper will close your passed-in
+ * ID.
+ */
+ fid = size1_helper(fid, filename, fapl_id, test_file_closing);
+ CHECK(fid, H5I_INVALID_HID, "size1_helper");
- ret = H5Oget_info_by_name2(file, DSETNAME[0], oinfo, H5O_INFO_HDR, H5P_DEFAULT);
- CHECK_I(ret, "H5Oget_info_by_name");
+ ret = H5Oget_info_by_name2(fid, DSETNAME[0], oinfo, H5O_INFO_HDR, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name");
- ret = H5Fclose(file);
- CHECK_I(ret, "H5Fclose");
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
- return h5_get_file_size(FILENAME, fapl_id);
-} /* getsize_testsize1 */
+ return h5_get_file_size(filename, fapl_id);
+} /* getsize_testsize1() */
/*-------------------------------------------------------------------------
@@ -787,13 +787,14 @@ test_sohm_size1(void)
unsigned use_shared = 0;
unsigned use_btree = 0;
- unsigned open_close = 0;
h5_stat_size_t file_sizes[9];
unsigned size_index = 0;
hsize_t oh_sizes[3];
unsigned oh_size_index = 0;
+#if 0 /* TBD: lying comment or bug. See Jira HDFFV-10646 */
hsize_t norm_oh_size;
+#endif /* Jira HDFFV-10646 */
hsize_t sohm_oh_size;
hsize_t sohm_btree_oh_size;
h5_stat_size_t norm_empty_filesize;
@@ -819,7 +820,6 @@ test_sohm_size1(void)
/* Create a FAPL with "semi" close degree, to detect dangling IDs */
fapl_id = H5Pcreate(H5P_FILE_ACCESS);
CHECK_I(fapl_id, "H5Pcreate");
-
ret = H5Pset_fclose_degree(fapl_id, H5F_CLOSE_SEMI);
CHECK_I(ret, "H5Pset_fclose_degree");
@@ -829,6 +829,7 @@ test_sohm_size1(void)
for (use_shared = 0; use_shared < 2; use_shared++) {
for (use_btree = 0; use_btree < 2; use_btree++) {
+ hbool_t test_open_close;
/* cannot use btree indexing without shared messages; skip case */
if (use_btree && !use_shared)
@@ -864,8 +865,10 @@ test_sohm_size1(void)
file_sizes[size_index++] = h5_get_file_size(FILENAME, fapl_id);
/* size of populated file, with different populating behaviors */
- for (open_close = 0; open_close < 2; open_close++)
- file_sizes[size_index++] = getsize_testsize1(FILENAME, fcpl_id, fapl_id, open_close, &oinfo);
+ test_open_close = TRUE;
+ file_sizes[size_index++] = getsize_testsize1(FILENAME, fcpl_id, fapl_id, test_open_close, &oinfo);
+ test_open_close = FALSE;
+ file_sizes[size_index++] = getsize_testsize1(FILENAME, fcpl_id, fapl_id, test_open_close, &oinfo);
oh_sizes[oh_size_index++] = oinfo.hdr.space.total;
ret = H5Pclose(fcpl_id);
@@ -890,7 +893,9 @@ test_sohm_size1(void)
norm_empty_filesize = file_sizes[0];
norm_final_filesize = file_sizes[1];
norm_final_filesize2 = file_sizes[2];
+#if 0 /* TBD: lying comment or bug. See Jira HDFFV-10646 */
norm_oh_size = oh_sizes[0];
+#endif /* Jira HDFFV-10646 */
sohm_empty_filesize = file_sizes[3];
sohm_final_filesize = file_sizes[4];
@@ -928,16 +933,16 @@ test_sohm_size1(void)
VERIFY(sohm_btree_empty_filesize, 1, "h5_get_file_size");
/* When full, the sohm btree file should be smaller than the normal file.
- * The sohm list file should be at least as small, since it doesn't need the
- * overhead of a B-tree.
+ * The sohm list file should be at least as small, since it doesn't need
+ * the overhead of a B-tree.
*/
if(sohm_btree_final_filesize >= norm_final_filesize)
VERIFY(sohm_btree_final_filesize, 1, "h5_get_file_size");
if(sohm_final_filesize > sohm_btree_final_filesize)
VERIFY(sohm_final_filesize, 1, "h5_get_file_size");
- /* Comparative sizes shouldn't change even if we open and close the file */
-
+ /* Comparative sizes shouldn't change even if we open and close the file
+ */
if(sohm_btree_final_filesize2 >= norm_final_filesize2)
VERIFY(sohm_btree_final_filesize2, 1, "h5_get_file_size");
if(sohm_final_filesize2 > sohm_btree_final_filesize2)
@@ -946,7 +951,7 @@ test_sohm_size1(void)
} /* test_sohm_size1 */
-/*-------------------------------------------------------------------------
+/*---------------------------------------------------------------------------
* Function: test_sohm_size_consistency_open_create
*
* Purpose: Tests that header size is different depending on file open
@@ -957,8 +962,9 @@ test_sohm_size1(void)
* Programmer: Jacob Smith
* 2018 November 1
*
- *-------------------------------------------------------------------------
+ *---------------------------------------------------------------------------
*/
+#if 0 /* TODO: REVEALS BUG TO BE FIXED - SEE JIRA HDFFV-10645 */
static void
test_sohm_size_consistency_open_create(void)
{
@@ -976,7 +982,8 @@ test_sohm_size_consistency_open_create(void)
unsigned btree_min = 10;
herr_t ret;
- MESSAGE(5, ("Testing that header size is consistent between H5Fopen and H5Fcreate\n"));
+ MESSAGE(5, \
+ ("Testing that header size is consistent between H5Fopen and H5Fcreate\n"));
/* Create a FAPL with "semi" close degree, to detect dangling IDs */
fapl_id = H5Pcreate(H5P_FILE_ACCESS);
@@ -1013,11 +1020,11 @@ test_sohm_size_consistency_open_create(void)
* Add messages to previously-created file */
file = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl_id);
CHECK_I(file, "H5Fopen");
- file = size1_helper(file, FILENAME, fapl_id, 0);
+ file = size1_helper(file, FILENAME, fapl_id, FALSE);
CHECK_I(file, "size1_helper");
/* Get the size of a dataset object header */
- ret = H5Oget_info_by_name2(file, DSETNAME[0], &oinfo, H5O_INFO_HDR, H5P_DEFAULT);
+ ret = H5Oget_info_by_name2(file, DSETNAME[0], &oinfo, H5O_INFO_HDR, H5P_DEFAULT);
CHECK_I(ret, "H5Oget_info_by_name");
oh_size_open = oinfo.hdr.space.total;
@@ -1028,7 +1035,7 @@ test_sohm_size_consistency_open_create(void)
* Add messages to a newly-created file */
file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, fapl_id);
CHECK_I(file, "H5Fcreate");
- file = size1_helper(file, FILENAME, fapl_id, 0);
+ file = size1_helper(file, FILENAME, fapl_id, FALSE);
CHECK_I(file, "size1_helper");
/* Get the size of a dataset object header */
@@ -1048,6 +1055,7 @@ test_sohm_size_consistency_open_create(void)
ret = H5Pclose(fapl_id);
CHECK_I(ret, "H5Pclose");
} /* test_sohm_size_consistency_open_create */
+#endif /* Jira HDFFV-10645 */
/*-------------------------------------------------------------------------
@@ -1131,7 +1139,7 @@ sohm_attr_helper(hid_t fcpl_id)
ret = H5Gclose(group_id);
CHECK_I(ret, "H5Gclose");
ret = H5Tclose(type_id);
- CHECK_I(ret, "H5Tclose")
+ CHECK_I(ret, "H5Tclose");
/* Flush the file to force data to be written */
ret = H5Fflush(file_id, H5F_SCOPE_GLOBAL);
@@ -1178,7 +1186,8 @@ sohm_attr_helper(hid_t fcpl_id)
static void
test_sohm_attrs(void)
{
- hid_t fcpl_id;
+ hid_t bad_fid = H5I_INVALID_HID;
+ hid_t fcpl_id = H5I_INVALID_HID;
unsigned i = 0;
#define TSOHM_TSA_NFLAGS_1 7
unsigned flags1[TSOHM_TSA_NFLAGS_1] = {
@@ -1238,7 +1247,8 @@ test_sohm_attrs(void)
MESSAGE(5, ("Testing that shared messages work with attributes\n"));
- /* No shared messages */
+ /* No shared messages
+ */
fcpl_id = H5Pcreate(H5P_FILE_CREATE);
CHECK_I(fcpl_id, "H5Pcreate");
ret = H5Pset_shared_mesg_nindexes(fcpl_id, 0);
@@ -1295,8 +1305,8 @@ test_sohm_attrs(void)
ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_SHMESG_ATTR_FLAG, 2);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
- ret = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT);
- VERIFY(ret, -1, "H5Fcreate");
+ bad_fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT);
+ VERIFY(bad_fid, H5I_INVALID_HID, "H5Fcreate");
ret = H5Pclose(fcpl_id);
CHECK_I(ret, "H5Pclose");
@@ -1328,7 +1338,6 @@ test_sohm_attrs(void)
} /* test_sohm_attrs */
-
/*-------------------------------------------------------------------------
* Function: size2_verify_plist1
@@ -1386,7 +1395,7 @@ size2_verify_plist1(hid_t plist)
ret = H5Pget_fill_value(plist, dtype1_id, &fill1);
CHECK_I(ret, "H5Pget_fill_value");
- ret = memcmp(&fill1, &fill1_correct, sizeof(fill1_correct));
+ ret = HDmemcmp(&fill1, &fill1_correct, sizeof(fill1_correct));
VERIFY(ret, 0, "memcmp");
ret = H5Tclose(dtype1_id);
@@ -1485,15 +1494,15 @@ size2_verify_plist2(hid_t plist)
static void
size2_dump_struct(const char *name, size2_helper_struct *sizes)
{
- puts(name);
- printf(" empty size: %llu\n", (unsigned long long)sizes->empty_size);
- printf(" first dataset: %llu \tdelta: %llu\n", (unsigned long long)sizes->first_dset, (unsigned long long)(sizes->first_dset - sizes->empty_size));
- printf("second dataset: %llu \tdelta: %llu\n", (unsigned long long)sizes->second_dset, (unsigned long long)(sizes->second_dset - sizes->first_dset));
- printf(" dsets 1: %llu \tdelta: %llu\n", (unsigned long long)sizes->dsets1, (unsigned long long)(sizes->dsets1 - sizes->second_dset));
- printf(" dsets 2: %llu \tdelta: %llu\n", (unsigned long long)sizes->dsets2, (unsigned long long)(sizes->dsets2 - sizes->dsets1));
- printf(" interleaved: %llu \tdelta: %llu\n", (unsigned long long)sizes->interleaved, (unsigned long long)(sizes->interleaved - sizes->dsets2));
- printf(" attributes: %llu \tdelta: %llu\n", (unsigned long long)sizes->attrs1, (unsigned long long)(sizes->attrs1 - sizes->interleaved));
- printf(" attributes 2: %llu \tdelta: %llu\n", (unsigned long long)sizes->attrs2, (unsigned long long)(sizes->attrs2 - sizes->attrs1));
+ HDputs(name);
+ HDprintf(" empty size: %llu\n", (unsigned long long)sizes->empty_size);
+ HDprintf(" first dataset: %llu \tdelta: %llu\n", (unsigned long long)sizes->first_dset, (unsigned long long)(sizes->first_dset - sizes->empty_size));
+ HDprintf("second dataset: %llu \tdelta: %llu\n", (unsigned long long)sizes->second_dset, (unsigned long long)(sizes->second_dset - sizes->first_dset));
+ HDprintf(" dsets 1: %llu \tdelta: %llu\n", (unsigned long long)sizes->dsets1, (unsigned long long)(sizes->dsets1 - sizes->second_dset));
+ HDprintf(" dsets 2: %llu \tdelta: %llu\n", (unsigned long long)sizes->dsets2, (unsigned long long)(sizes->dsets2 - sizes->dsets1));
+ HDprintf(" interleaved: %llu \tdelta: %llu\n", (unsigned long long)sizes->interleaved, (unsigned long long)(sizes->interleaved - sizes->dsets2));
+ HDprintf(" attributes: %llu \tdelta: %llu\n", (unsigned long long)sizes->attrs1, (unsigned long long)(sizes->attrs1 - sizes->interleaved));
+ HDprintf(" attributes 2: %llu \tdelta: %llu\n", (unsigned long long)sizes->attrs2, (unsigned long long)(sizes->attrs2 - sizes->attrs1));
} /* size2_dump_struct */
#endif /* NOT_NOW */
@@ -1715,7 +1724,7 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
group_id = H5Gopen2(file_id, "group", H5P_DEFAULT);
CHECK_I(group_id, "H5Gopen2");
}
- } /* for each dataset */
+ }
/* Close file and get its size now */
ret = H5Gclose(group_id);
@@ -1732,7 +1741,8 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
CHECK_I(group_id, "H5Gcreate2");
/* Create NUM_DATASETS datasets in the new group */
- for(x=0; x<NUM_DATASETS; x+=2) {
+ for(x=0; x<NUM_DATASETS; x+=2)
+ {
dset_id = H5Dcreate2(group_id, DSETNAME[x], dtype1_id, dspace1_id, H5P_DEFAULT, dcpl1_id, H5P_DEFAULT);
CHECK_I(dset_id, "H5Dcreate2");
@@ -1768,7 +1778,7 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
group_id = H5Gopen2(file_id, "interleaved group", H5P_DEFAULT);
CHECK_I(group_id, "H5Gopen2");
}
- } /* for each even dataset */
+ }
/* Close file and get its size now */
ret = H5Gclose(group_id);
@@ -1810,7 +1820,7 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
group_id = H5Gopen2(file_id, "group", H5P_DEFAULT);
CHECK_I(group_id, "H5Gopen2");
}
- } /* for each attribute */
+ }
/* Close file and get its size now */
ret = H5Gclose(group_id);
@@ -1826,7 +1836,8 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
group_id = H5Gopen2(file_id, "interleaved group", H5P_DEFAULT);
CHECK_I(group_id, "H5Gopen2");
- for(x=0; x<NUM_ATTRIBUTES; ++x) {
+ for(x=0; x<NUM_ATTRIBUTES; ++x)
+ {
/* Create the same name and value for each attribute as before */
attr_string1[0] = attr_name[0] = (char)((x / 10) + '0');
attr_string1[1] = attr_name[1] = (char)((x % 10) + '0');
@@ -1849,8 +1860,7 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
group_id = H5Gopen2(file_id, "interleaved group", H5P_DEFAULT);
CHECK_I(group_id, "H5Gopen2");
}
- } /* for each attribute */
-
+ }
/* Close file and get its size now */
ret = H5Gclose(group_id);
CHECK_I(ret, "H5Gclose");
@@ -2068,7 +2078,7 @@ size2_verify(void)
CHECK_I(attr1_id, "H5Aclose");
ret = H5Aclose(attr2_id);
CHECK_I(attr2_id, "H5Aclose");
- } /* for each attribute */
+ }
/* Close everything */
ret = H5Tclose(attr_type_id);
@@ -2697,7 +2707,7 @@ test_sohm_size2(int close_reopen)
VERIFY(0, 1, "h5_get_file_size");
if((h5_stat_size_t)((float)share_tiny_index.attrs2 * OVERHEAD_ALLOWED) < type_space_index.attrs2)
VERIFY(0, 1, "h5_get_file_size");
-} /* end test_sohm_size2() */
+} /* test_sohm_size2 */
/*-------------------------------------------------------------------------
@@ -2716,21 +2726,19 @@ test_sohm_size2(int close_reopen)
static void
delete_helper_write(hid_t file_id, hid_t *dspace_id, hid_t *dcpl_id, int x)
{
- hid_t dset_id = -1;
- hid_t attr_id = -1;
- char wdata;
+ hid_t dset_id = -1;
+ hid_t attr_id = -1;
+ char wdata;
herr_t ret;
dset_id = H5Dcreate2(file_id, DSETNAME[x], H5T_NATIVE_CHAR, dspace_id[x], H5P_DEFAULT, dcpl_id[x], H5P_DEFAULT);
CHECK_I(dset_id, "H5Dcreate2");
-
wdata = (char)(x + 'a');
ret = H5Dwrite(dset_id, H5T_NATIVE_CHAR, dspace_id[x], dspace_id[x], H5P_DEFAULT, &wdata);
CHECK_I(ret, "H5Dwrite");
attr_id = H5Acreate2(dset_id, "attr_name", H5T_NATIVE_CHAR, dspace_id[x], H5P_DEFAULT, H5P_DEFAULT);
CHECK_I(attr_id, "H5Acreate2");
-
ret = H5Awrite(attr_id, H5T_NATIVE_CHAR, &wdata);
CHECK_I(ret, "H5Awrite");
@@ -2764,7 +2772,6 @@ delete_helper_read(hid_t file_id, hid_t *dspace_id, int x)
dset_id = H5Dopen2(file_id, DSETNAME[x], H5P_DEFAULT);
CHECK_I(dset_id, "H5Dopen2");
-
rdata = '\0';
ret = H5Dread(dset_id, H5T_NATIVE_CHAR, dspace_id[x], dspace_id[x], H5P_DEFAULT, &rdata);
CHECK_I(ret, "H5Dread");
@@ -2772,13 +2779,11 @@ delete_helper_read(hid_t file_id, hid_t *dspace_id, int x)
attr_id = H5Aopen(dset_id, "attr_name", H5P_DEFAULT);
CHECK_I(attr_id, "H5Aopen");
-
rdata = '\0';
ret = H5Aread(attr_id, H5T_NATIVE_CHAR, &rdata);
CHECK_I(ret, "H5Dread");
VERIFY(rdata, (x + 'a'), "H5Dread");
- /* Cleanup */
ret = H5Aclose(attr_id);
CHECK_I(ret, "H5Aclose");
ret = H5Dclose(dset_id);
@@ -3019,7 +3024,7 @@ test_sohm_delete(void)
ret = H5Pclose(dcpl_id[x]);
CHECK_I(ret, "H5Pclose");
} /* end for */
-} /* end test_sohm_delete() */
+} /* test_sohm_delete */
/*-------------------------------------------------------------------------
@@ -3348,7 +3353,7 @@ verify_dataset_extension(hid_t fcpl_id, hbool_t close_reopen)
hsize_t out_dims[2];
hsize_t out_maxdims[2];
int x;
- int old_nerrs; /* Number of errors when entering this routine */
+ int old_nerrs; /* Number of errors when entering this routine */
herr_t ret;
hsize_t *space_dims[3];
@@ -3454,28 +3459,25 @@ verify_dataset_extension(hid_t fcpl_id, hbool_t close_reopen)
CHECK_I(orig_space_id, "H5Screate_simple");
dset1_id = H5Dcreate2(file_id, "dataset", H5T_NATIVE_LONG, orig_space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
CHECK_I(dset1_id, "H5Dcreate2");
-
if(close_reopen)
TSOHM_VDE_CLOSE_REOPEN_FILE_AND_DSETS(1);
/* Create another dataset starting with the same dataspace */
dset2_id = H5Dcreate2(file_id, "dataset2", H5T_NATIVE_LONG, orig_space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
CHECK_I(dset2_id, "H5Dcreate2");
-
- if(close_reopen)
+ if (close_reopen)
TSOHM_VDE_CLOSE_REOPEN_FILE_AND_DSETS(2);
/* Create a third dataset with the same dataspace */
dset3_id = H5Dcreate2(file_id, "dataset3", H5T_NATIVE_LONG, orig_space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
CHECK_I(dset3_id, "H5Dcreate2");
-
- if(close_reopen)
+ if (close_reopen)
TSOHM_VDE_CLOSE_REOPEN_FILE_AND_DSETS(3);
/* Extend the first dataset */
ret = H5Dset_extent(dset1_id, dims2);
CHECK_I(ret, "H5Dset_extent");
- if(close_reopen)
+ if (close_reopen)
TSOHM_VDE_CLOSE_REOPEN_FILE_AND_DSETS(3);
space_dims[0] = dims2;
@@ -3495,7 +3497,6 @@ verify_dataset_extension(hid_t fcpl_id, hbool_t close_reopen)
/* Extend the third dataset */
ret = H5Dset_extent(dset3_id, dims2);
CHECK_I(ret, "H5Dset_extent");
-
if(close_reopen)
TSOHM_VDE_CLOSE_REOPEN_FILE_AND_DSETS(3);
@@ -3550,13 +3551,13 @@ verify_dataset_extension(hid_t fcpl_id, hbool_t close_reopen)
*/
dset3_id = H5Dcreate2(file_id, "dataset3", H5T_NATIVE_LONG, orig_space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
CHECK_I(dset3_id, "H5Dcreate2");
- if (close_reopen)
+ if(close_reopen)
TSOHM_VDE_CLOSE_REOPEN_FILE_AND_DSETS(3);
/* Extend the third dataset */
ret = H5Dset_extent(dset3_id, dims2);
CHECK_I(ret, "H5Dset_extent");
- if (close_reopen)
+ if(close_reopen)
TSOHM_VDE_CLOSE_REOPEN_FILE_AND_DSETS(3);
TSOHM_VDE_VERIFY_SPACES(space_dims);
@@ -3577,7 +3578,7 @@ verify_dataset_extension(hid_t fcpl_id, hbool_t close_reopen)
ret = H5Pclose(dcpl_id);
CHECK_I(ret, "H5Pclose");
- /* Complaini if this test generated errors */
+ /* Complain if this test generated errors */
if(old_nerrs == GetTestNumErrs())
return(0);
else
@@ -3790,12 +3791,11 @@ test_sohm_external_dtype(void)
ret = H5Dwrite(dataset2, s1_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig);
CHECK_I(ret, "H5Dwrite");
+ /* Close references to the first file */
ret = H5Dclose(dataset2);
CHECK_I(ret, "H5Dclose");
-
ret = H5Tclose(dset1_tid);
CHECK_I(ret, "H5Tclose");
-
ret = H5Fclose(file1);
CHECK_I(ret, "H5Fclose");
@@ -3809,13 +3809,11 @@ test_sohm_external_dtype(void)
dtype_class = H5Tget_class(dset2_tid);
VERIFY(dtype_class, H5T_COMPOUND, "H5Tget_class");
+ /* Cleanup */
ret = H5Tclose(dset2_tid);
CHECK_I(ret, "H5Tclose");
-
ret = H5Dclose(dataset2);
CHECK_I(ret, "H5Dclose");
-
- /* Cleanup */
ret = H5Sclose(space);
CHECK_I(ret, "H5Sclose");
ret = H5Tclose(s1_tid);
@@ -3838,7 +3836,7 @@ test_sohm(void)
{
MESSAGE(5, ("Testing Shared Object Header Messages\n"));
- test_sohm_fcpl(); /* Test SOHMs and file creation plists */
+ test_sohm_fcpl(); /* Test SOHMs and file creation plists */
test_sohm_fcpl_errors(); /* Bogus H5P* calls for SOHMs */
test_sohm_size1(); /* Tests the sizes of files with one SOHM */
#if 0 /* TODO: REVEALS BUG TO BE FIXED - SEE JIRA HDFFV-10645 */
@@ -3856,17 +3854,17 @@ test_sohm(void)
test_sohm_extend_dset(); /* Test extending shared datasets */
test_sohm_external_dtype(); /* Test using datatype in another file */
-} /* test_sohm() */
+} /* test_sohm */
/*-------------------------------------------------------------------------
- * Function: cleanup_sohm
+ * Function: cleanup_sohm
*
- * Purpose: Cleanup temporary test files
+ * Purpose: Cleanup temporary test files
*
- * Return: none
+ * Return: none
*
- * Programmer: James Laird
+ * Programmer: James Laird
* October 9, 2006
*
* Modifications:
@@ -3876,8 +3874,8 @@ test_sohm(void)
void
cleanup_sohm(void)
{
- remove(FILENAME);
- remove(FILENAME_SRC);
- remove(FILENAME_DST);
+ HDremove(FILENAME);
+ HDremove(FILENAME_SRC);
+ HDremove(FILENAME_DST);
} /* cleanup_sohm */
diff --git a/test/tunicode.c b/test/tunicode.c
index 5a60036..255dc50 100644
--- a/test/tunicode.c
+++ b/test/tunicode.c
@@ -854,7 +854,7 @@ void test_unicode(void)
*/
void cleanup_unicode(void)
{
- remove(FILENAME);
+ HDremove(FILENAME);
}
diff --git a/test/vds_env.c b/test/vds_env.c
index 4f93bf0..fc6652b 100644
--- a/test/vds_env.c
+++ b/test/vds_env.c
@@ -22,7 +22,7 @@ const char *FILENAME[] = {
"vds_env_virt_0",
"vds_env_virt_3",
"vds_env_src_2",
- "vds_env_%%_src2",
+ "vds_env%%_src2",
NULL
};
@@ -130,11 +130,14 @@ test_vds_prefix_second(unsigned config, hid_t fapl)
/* Create source file if requested */
if(config & TEST_IO_DIFFERENT_FILE) {
- HDgetcwd(buffer, 1024);
- HDchdir(TMPDIR);
+ if(NULL == HDgetcwd(buffer, 1024))
+ TEST_ERROR
+ if(HDchdir(TMPDIR) < 0)
+ TEST_ERROR
if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- HDchdir(buffer);
+ if(HDchdir(buffer) < 0)
+ TEST_ERROR
}
else {
srcfile[0] = vfile;
@@ -211,11 +214,14 @@ test_vds_prefix_second(unsigned config, hid_t fapl)
/* Reopen srcdset and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
if(config & TEST_IO_DIFFERENT_FILE) {
- HDgetcwd(buffer, 1024);
- HDchdir(TMPDIR);
+ if(NULL == HDgetcwd(buffer, 1024))
+ TEST_ERROR
+ if(HDchdir(TMPDIR) < 0)
+ TEST_ERROR
if((srcfile[0] = H5Fopen(srcfilename, H5F_ACC_RDONLY, fapl)) < 0)
TEST_ERROR
- HDchdir(buffer);
+ if(HDchdir(buffer) < 0)
+ TEST_ERROR
}
if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0)
TEST_ERROR