summaryrefslogtreecommitdiffstats
path: root/test/cache_image.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/cache_image.c')
-rw-r--r--test/cache_image.c267
1 files changed, 205 insertions, 62 deletions
diff --git a/test/cache_image.c b/test/cache_image.c
index 10e9a8a..ee49502 100644
--- a/test/cache_image.c
+++ b/test/cache_image.c
@@ -40,27 +40,27 @@ static void attempt_swmr_open_hdf5_file(hbool_t create_file,
static void verify_datasets(hid_t file_id, int min_dset, int max_dset);
/* local test function declarations */
-static unsigned check_cache_image_ctl_flow_1(void);
-static unsigned check_cache_image_ctl_flow_2(void);
-static unsigned check_cache_image_ctl_flow_3(void);
-static unsigned check_cache_image_ctl_flow_4(void);
-static unsigned check_cache_image_ctl_flow_5(void);
-static unsigned check_cache_image_ctl_flow_6(void);
-
-static unsigned cache_image_smoke_check_1(void);
-static unsigned cache_image_smoke_check_2(void);
-static unsigned cache_image_smoke_check_3(void);
-static unsigned cache_image_smoke_check_4(void);
-static unsigned cache_image_smoke_check_5(void);
-static unsigned cache_image_smoke_check_6(void);
-
-static unsigned cache_image_api_error_check_1(void);
-static unsigned cache_image_api_error_check_2(void);
-static unsigned cache_image_api_error_check_3(void);
-static unsigned cache_image_api_error_check_4(void);
-
-static unsigned get_free_sections_test(void);
-static unsigned evict_on_close_test(void);
+static unsigned check_cache_image_ctl_flow_1(hbool_t single_file_vfd);
+static unsigned check_cache_image_ctl_flow_2(hbool_t single_file_vfd);
+static unsigned check_cache_image_ctl_flow_3(hbool_t single_file_vfd);
+static unsigned check_cache_image_ctl_flow_4(hbool_t single_file_vfd);
+static unsigned check_cache_image_ctl_flow_5(hbool_t single_file_vfd);
+static unsigned check_cache_image_ctl_flow_6(hbool_t single_file_vfd);
+
+static unsigned cache_image_smoke_check_1(hbool_t single_file_vfd);
+static unsigned cache_image_smoke_check_2(hbool_t single_file_vfd);
+static unsigned cache_image_smoke_check_3(hbool_t single_file_vfd);
+static unsigned cache_image_smoke_check_4(hbool_t single_file_vfd);
+static unsigned cache_image_smoke_check_5(hbool_t single_file_vfd);
+static unsigned cache_image_smoke_check_6(hbool_t single_file_vfd);
+
+static unsigned cache_image_api_error_check_1(hbool_t single_file_vfd);
+static unsigned cache_image_api_error_check_2(hbool_t single_file_vfd);
+static unsigned cache_image_api_error_check_3(hbool_t single_file_vfd);
+static unsigned cache_image_api_error_check_4(hbool_t single_file_vfd);
+
+static unsigned get_free_sections_test(hbool_t single_file_vfd);
+static unsigned evict_on_close_test(hbool_t single_file_vfd);
/****************************************************************************/
@@ -713,6 +713,9 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected,
file_id = H5Fopen(hdf_file_name, H5F_ACC_RDWR, fapl_id);
}
+ /* tidy up */
+ H5Pclose(fapl_id);
+
if ( file_id < 0 ) {
pass = FALSE;
@@ -1329,7 +1332,7 @@ verify_datasets(hid_t file_id, int min_dset, int max_dset)
*/
static unsigned
-check_cache_image_ctl_flow_1(void)
+check_cache_image_ctl_flow_1(hbool_t single_file_vfd)
{
const char * fcn_name = "check_cache_image_ctl_flow_1()";
char filename[512];
@@ -1341,6 +1344,13 @@ check_cache_image_ctl_flow_1(void)
TESTING("metadata cache image control flow test 1");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
if ( show_progress )
@@ -1608,7 +1618,7 @@ check_cache_image_ctl_flow_1(void)
*/
static unsigned
-check_cache_image_ctl_flow_2(void)
+check_cache_image_ctl_flow_2(hbool_t single_file_vfd)
{
const char * fcn_name = "check_cache_image_ctl_flow_2()";
char filename[512];
@@ -1620,6 +1630,13 @@ check_cache_image_ctl_flow_2(void)
TESTING("metadata cache image control flow test 2");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
if ( show_progress )
@@ -1871,7 +1888,7 @@ check_cache_image_ctl_flow_2(void)
*/
static unsigned
-check_cache_image_ctl_flow_3(void)
+check_cache_image_ctl_flow_3(hbool_t single_file_vfd)
{
const char * fcn_name = "check_cache_image_ctl_flow_3()";
char filename[512];
@@ -1883,6 +1900,13 @@ check_cache_image_ctl_flow_3(void)
TESTING("metadata cache image control flow test 3");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
if ( show_progress ) /* 0 */
@@ -2242,7 +2266,7 @@ check_cache_image_ctl_flow_3(void)
*/
static unsigned
-check_cache_image_ctl_flow_4(void)
+check_cache_image_ctl_flow_4(hbool_t single_file_vfd)
{
const char * fcn_name = "check_cache_image_ctl_flow_4()";
char filename[512];
@@ -2254,6 +2278,13 @@ check_cache_image_ctl_flow_4(void)
TESTING("metadata cache image control flow test 4");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
if ( show_progress ) /* 0 */
@@ -2573,7 +2604,7 @@ check_cache_image_ctl_flow_4(void)
*/
static unsigned
-check_cache_image_ctl_flow_5(void)
+check_cache_image_ctl_flow_5(hbool_t single_file_vfd)
{
const char * fcn_name = "check_cache_image_ctl_flow_5()";
char filename[512];
@@ -2585,6 +2616,13 @@ check_cache_image_ctl_flow_5(void)
TESTING("metadata cache image control flow test 5");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
if ( show_progress ) /* 0 */
@@ -2854,7 +2892,7 @@ check_cache_image_ctl_flow_5(void)
*/
static unsigned
-check_cache_image_ctl_flow_6(void)
+check_cache_image_ctl_flow_6(hbool_t single_file_vfd)
{
const char * fcn_name = "check_cache_image_ctl_flow_6()";
char filename[512];
@@ -2866,6 +2904,13 @@ check_cache_image_ctl_flow_6(void)
TESTING("metadata cache image control flow test 6");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
if ( show_progress ) /* 0 */
@@ -3139,7 +3184,7 @@ check_cache_image_ctl_flow_6(void)
*/
static unsigned
-cache_image_smoke_check_1(void)
+cache_image_smoke_check_1(hbool_t single_file_vfd)
{
const char * fcn_name = "cache_image_smoke_check_1()";
char filename[512];
@@ -3151,6 +3196,13 @@ cache_image_smoke_check_1(void)
TESTING("metadata cache image smoke check 1");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
if ( show_progress )
@@ -3562,7 +3614,7 @@ cache_image_smoke_check_1(void)
*/
static unsigned
-cache_image_smoke_check_2(void)
+cache_image_smoke_check_2(hbool_t single_file_vfd)
{
const char * fcn_name = "cache_image_smoke_check_2()";
char filename[512];
@@ -3574,6 +3626,13 @@ cache_image_smoke_check_2(void)
TESTING("metadata cache image smoke check 2");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
if ( show_progress )
@@ -3863,7 +3922,7 @@ cache_image_smoke_check_2(void)
*/
static unsigned
-cache_image_smoke_check_3(void)
+cache_image_smoke_check_3(hbool_t single_file_vfd)
{
const char * fcn_name = "cache_image_smoke_check_3()";
char filename[512];
@@ -3875,6 +3934,13 @@ cache_image_smoke_check_3(void)
TESTING("metadata cache image smoke check 3");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
if ( show_progress )
@@ -4248,7 +4314,7 @@ cache_image_smoke_check_3(void)
*/
static unsigned
-cache_image_smoke_check_4(void)
+cache_image_smoke_check_4(hbool_t single_file_vfd)
{
const char * fcn_name = "cache_image_smoke_check_4()";
char filename[512];
@@ -4262,6 +4328,13 @@ cache_image_smoke_check_4(void)
TESTING("metadata cache image smoke check 4");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
if ( show_progress )
@@ -4650,10 +4723,10 @@ cache_image_smoke_check_4(void)
*-------------------------------------------------------------------------
*/
-#define MAX_NUM_GROUPS 128
+#define MAX_NUM_GROUPS 64
static unsigned
-cache_image_smoke_check_5(void)
+cache_image_smoke_check_5(hbool_t single_file_vfd)
{
const char * fcn_name = "cache_image_smoke_check_5()";
char filename[512];
@@ -4670,6 +4743,13 @@ cache_image_smoke_check_5(void)
TESTING("metadata cache image smoke check 5");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
if ( show_progress )
@@ -4679,12 +4759,16 @@ cache_image_smoke_check_5(void)
/* setup the file name */
if ( pass ) {
- if ( h5_fixname(FILENAMES[0], H5P_DEFAULT, filename, sizeof(filename))
+ hid_t fapl_id = h5_fileaccess();
+
+ if ( h5_fixname(FILENAMES[0], fapl_id, filename, sizeof(filename))
== NULL ) {
pass = FALSE;
failure_mssg = "h5_fixname() failed.\n";
}
+
+ H5Pclose(fapl_id);
}
if ( show_progress )
@@ -5168,7 +5252,7 @@ cache_image_smoke_check_5(void)
*/
static unsigned
-cache_image_smoke_check_6(void)
+cache_image_smoke_check_6(hbool_t single_file_vfd)
{
const char * fcn_name = "cache_image_smoke_check_6()";
char filename[512];
@@ -5183,6 +5267,13 @@ cache_image_smoke_check_6(void)
TESTING("metadata cache image smoke check 6");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
if ( show_progress )
@@ -5578,7 +5669,7 @@ cache_image_smoke_check_6(void)
*/
static unsigned
-cache_image_api_error_check_1(void)
+cache_image_api_error_check_1(hbool_t single_file_vfd)
{
const char * fcn_name = "cache_image_api_error_check_1()";
char filename[512];
@@ -5590,6 +5681,13 @@ cache_image_api_error_check_1(void)
TESTING("metadata cache image api error check 1");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
if ( show_progress )
@@ -5954,7 +6052,7 @@ cache_image_api_error_check_1(void)
*/
static unsigned
-cache_image_api_error_check_2(void)
+cache_image_api_error_check_2(hbool_t single_file_vfd)
{
const char * fcn_name = "cache_image_api_error_check_2()";
char filename[512];
@@ -5966,6 +6064,13 @@ cache_image_api_error_check_2(void)
TESTING("metadata cache image api error check 2");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
if ( show_progress )
@@ -6365,7 +6470,7 @@ cache_image_api_error_check_2(void)
*/
static unsigned
-cache_image_api_error_check_3(void)
+cache_image_api_error_check_3(hbool_t single_file_vfd)
{
const char * fcn_name = "cache_image_api_error_check_3()";
char filename[512];
@@ -6377,6 +6482,13 @@ cache_image_api_error_check_3(void)
TESTING("metadata cache image api error check 3");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
if ( show_progress )
@@ -6649,7 +6761,7 @@ cache_image_api_error_check_3(void)
*/
static unsigned
-cache_image_api_error_check_4(void)
+cache_image_api_error_check_4(hbool_t single_file_vfd)
{
const char * fcn_name = "cache_image_api_error_check_4()";
char filename[512];
@@ -6663,6 +6775,13 @@ cache_image_api_error_check_4(void)
TESTING("metadata cache image api error check 4");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
if ( show_progress )
@@ -7238,7 +7357,7 @@ cache_image_api_error_check_4(void)
*-------------------------------------------------------------------------
*/
static unsigned
-get_free_sections_test(void)
+get_free_sections_test(hbool_t single_file_vfd)
{
const char * fcn_name = "get_free_sections_test()";
char filename[512];
@@ -7251,6 +7370,13 @@ get_free_sections_test(void)
TESTING("Cache image / H5Fget_free_sections() interaction");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
if ( show_progress )
@@ -7710,7 +7836,7 @@ get_free_sections_test(void)
*-------------------------------------------------------------------------
*/
static unsigned
-evict_on_close_test(void)
+evict_on_close_test(hbool_t single_file_vfd)
{
#ifndef H5_HAVE_PARALLEL
const char * fcn_name = "evict_on_close_test()";
@@ -7731,6 +7857,13 @@ evict_on_close_test(void)
return 0;
#else
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
if ( show_progress )
@@ -8041,9 +8174,16 @@ evict_on_close_test(void)
int
main(void)
{
+ const char *env_h5_drvr; /* File driver value from environment */
+ hbool_t single_file_vfd; /* Whether VFD used stores data in a single file */
unsigned nerrs = 0;
int express_test;
+ /* Get the VFD to use */
+ env_h5_drvr = HDgetenv("HDF5_DRIVER");
+ if(env_h5_drvr == NULL)
+ env_h5_drvr = "nomatch";
+
H5open();
express_test = GetTestExpress();
@@ -8053,27 +8193,30 @@ main(void)
printf(" express_test = %d\n", express_test);
printf("=========================================\n");
- nerrs += check_cache_image_ctl_flow_1();
- nerrs += check_cache_image_ctl_flow_2();
- nerrs += check_cache_image_ctl_flow_3();
- nerrs += check_cache_image_ctl_flow_4();
- nerrs += check_cache_image_ctl_flow_5();
- nerrs += check_cache_image_ctl_flow_6();
-
- nerrs += cache_image_smoke_check_1();
- nerrs += cache_image_smoke_check_2();
- nerrs += cache_image_smoke_check_3();
- nerrs += cache_image_smoke_check_4();
- nerrs += cache_image_smoke_check_5();
- nerrs += cache_image_smoke_check_6();
-
- nerrs += cache_image_api_error_check_1();
- nerrs += cache_image_api_error_check_2();
- nerrs += cache_image_api_error_check_3();
- nerrs += cache_image_api_error_check_4();
-
- nerrs += get_free_sections_test();
- nerrs += evict_on_close_test();
+ /* Check for VFD which stores data in multiple files */
+ single_file_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family"));
+
+ nerrs += check_cache_image_ctl_flow_1(single_file_vfd);
+ nerrs += check_cache_image_ctl_flow_2(single_file_vfd);
+ nerrs += check_cache_image_ctl_flow_3(single_file_vfd);
+ nerrs += check_cache_image_ctl_flow_4(single_file_vfd);
+ nerrs += check_cache_image_ctl_flow_5(single_file_vfd);
+ nerrs += check_cache_image_ctl_flow_6(single_file_vfd);
+
+ nerrs += cache_image_smoke_check_1(single_file_vfd);
+ nerrs += cache_image_smoke_check_2(single_file_vfd);
+ nerrs += cache_image_smoke_check_3(single_file_vfd);
+ nerrs += cache_image_smoke_check_4(single_file_vfd);
+ nerrs += cache_image_smoke_check_5(single_file_vfd);
+ nerrs += cache_image_smoke_check_6(single_file_vfd);
+
+ nerrs += cache_image_api_error_check_1(single_file_vfd);
+ nerrs += cache_image_api_error_check_2(single_file_vfd);
+ nerrs += cache_image_api_error_check_3(single_file_vfd);
+ nerrs += cache_image_api_error_check_4(single_file_vfd);
+
+ nerrs += get_free_sections_test(single_file_vfd);
+ nerrs += evict_on_close_test(single_file_vfd);
return(nerrs > 0);