Let tests provide a "hook" that runs after each step in create_zoo().

Provide a hook in vfd_swmr_zoo_writer that calls H5Fvfd_swmr_end_tick().
This commit is contained in:
David Young
2020-03-23 14:55:07 -05:00
parent 51b8fa3ffe
commit cb5e1ead29
5 changed files with 40 additions and 1 deletions

View File

@@ -146,7 +146,7 @@ else
noinst_LTLIBRARIES=libh5test.la
endif
libh5test_la_SOURCES=h5test.c testframe.c cache_common.c swmr_common.c external_common.c vfd_swmr_common.c
libh5test_la_SOURCES=h5test.c testframe.c cache_common.c swmr_common.c external_common.c stubs.c vfd_swmr_common.c
# Use libhd5test.la to compile all of the tests
LDADD=libh5test.la $(LIBHDF5)

View File

@@ -3192,6 +3192,7 @@ tend_zoo(hid_t fid, const char *base_path, int proc_num, bool skip_varlen,
!create_or_validate_selection(fid, full_path, proc_num, i,
skip_varlen, false))
break;
zoo_create_hook(fid);
if (!create_or_validate_selection(fid, full_path, proc_num, i,
skip_varlen, true))
break;

View File

@@ -51,3 +51,9 @@ void vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data);
void ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data);
void vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data);
/* Individual tests can override zoo_create_hook(), which is called
* after each step of create_zoo(). The `hid_t` argument identifies
* the file where the step was performed. The test library provides a
* default implementation of zoo_create_hook() that does nothing.
*/
void zoo_create_hook(hid_t);

25
test/stubs.c Normal file
View File

@@ -0,0 +1,25 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "h5test.h"
#include "genall5.h"
/* The default, do-nothing implementation of zoo_create_hook(), which
* is called after each create_zoo() step.
*/
void
zoo_create_hook(hid_t H5_ATTR_UNUSED fid)
{
return;
}

View File

@@ -53,6 +53,13 @@ print_cache_hits(H5C_t *cache)
dbgf(3, "\n");
}
void
zoo_create_hook(hid_t fid)
{
dbgf(3, "%s: enter\n", __func__);
H5Fvfd_swmr_end_tick(fid);
}
static void
usage(const char *progname)
{