mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-02-05 15:42:32 +08:00
Merge pull request #221 in HDFFV/hdf5 from ~BYRN/hdf5_adb:develop to develop
Buildbot tests passed * commit '69f975f56792acb9c7a4a8109c43081045b0eafe': hdf5 lib needed for extend_dset link. Add test lib to extend_dset test link line Add hl test dir and test dlib Fix h5test.h include issue
This commit is contained in:
commit
6a8222b6a5
@ -14,8 +14,8 @@ PROJECT (HDF5_HL_TEST)
|
||||
set (srcdir ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
configure_file (${HDF5_HL_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY)
|
||||
|
||||
INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR})
|
||||
INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR})
|
||||
include_directories (${CMAKE_CURRENT_BINARY_DIR})
|
||||
include_directories (${HDF5_TEST_SRC_DIR})
|
||||
|
||||
# --------------------------------------------------------------------
|
||||
# Macro used to add a unit test
|
||||
|
@ -9,9 +9,9 @@ set (H5WATCH_SOURCES
|
||||
)
|
||||
|
||||
#-- Add h5watch program
|
||||
INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib)
|
||||
INCLUDE_DIRECTORIES (${HDF5_HL_TOOLS_DIR}/src)
|
||||
INCLUDE_DIRECTORIES (${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR})
|
||||
include_directories (${HDF5_TOOLS_DIR}/lib)
|
||||
include_directories (${HDF5_HL_TOOLS_DIR}/src)
|
||||
include_directories (${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR})
|
||||
|
||||
add_executable (h5watch ${H5WATCH_SOURCES})
|
||||
TARGET_NAMING (h5watch STATIC)
|
||||
@ -20,6 +20,8 @@ target_link_libraries (h5watch ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_T
|
||||
set_target_properties (h5watch PROPERTIES FOLDER tools/hl)
|
||||
|
||||
if (BUILD_TESTING)
|
||||
include_directories (${HDF5_TEST_SRC_DIR})
|
||||
include_directories(${HDF5_HL_SRC_DIR}/test)
|
||||
#-- Add swmr_check_compat_vfd program
|
||||
set (hl_swmr_check_compat_vfd_SOURCES
|
||||
${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}/swmr_check_compat_vfd.c
|
||||
@ -37,7 +39,7 @@ if (BUILD_TESTING)
|
||||
add_executable (extend_dset ${extend_dset_SOURCES})
|
||||
TARGET_NAMING (extend_dset STATIC)
|
||||
TARGET_C_PROPERTIES (extend_dset STATIC " " " ")
|
||||
target_link_libraries (extend_dset ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
|
||||
target_link_libraries (extend_dset ${HDF5_HL_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
|
||||
set_target_properties (extend_dset PROPERTIES FOLDER tools/hl)
|
||||
|
||||
add_executable (h5watchgentest ${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}/h5watchgentest.c)
|
||||
|
@ -21,7 +21,7 @@
|
||||
include $(top_srcdir)/config/commence.am
|
||||
|
||||
# Include src and tools/lib directories
|
||||
AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/tools/lib -I$(top_srcdir)/hl/src
|
||||
AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/tools/lib -I$(top_srcdir)/hl/src -I$(top_srcdir)/hl/test
|
||||
|
||||
# These are our main targets, the tools
|
||||
TEST_SCRIPT=testh5watch.sh
|
||||
@ -43,7 +43,7 @@ LDADD=$(LIBH5_HL) $(LIBH5TOOLS) $(LIBHDF5)
|
||||
extend_dset_CPPFLAGS=$(AM_CPPFLAGS) -I$(top_srcdir)/test
|
||||
# Add extend_dset specific library flags here
|
||||
# (add the main test library to the list of libraries)
|
||||
extend_dset_LDADD=$(LDADD) $(LIBH5TEST)
|
||||
extend_dset_LDADD=$(LDADD) $(LIBH5TEST) $(LIBHDF5)
|
||||
|
||||
#
|
||||
CHECK_CLEANFILES+=*.h5
|
||||
|
@ -13,8 +13,7 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#include "H5HLprivate2.h"
|
||||
#include "h5test.h"
|
||||
#include "h5hltest.h"
|
||||
|
||||
/*
|
||||
* Extending datasets in WATCH.h5 generated by h5watchgentest.c
|
||||
@ -35,24 +34,24 @@
|
||||
/* Size of data buffer */
|
||||
#define TEST_BUF_SIZE 100
|
||||
|
||||
/*
|
||||
/*
|
||||
* Test variations (incremental) for one-dimensional dataset:
|
||||
* Varies from 10->13->12->12->1->3
|
||||
* Varies from 10->13->12->12->1->3
|
||||
*/
|
||||
#define ONE_NTESTS 5
|
||||
#define ONE_NTESTS 5
|
||||
int one_tests[ONE_NTESTS] = {3, -1, 0, -11, 2};
|
||||
|
||||
/*
|
||||
/*
|
||||
* Test variations (incremental) for two-dimensional dataset:
|
||||
* Varies from {4,10}->{6,12}->{8,1}->{10,1}->
|
||||
* {3,3}->{2,2}->{1,2}->
|
||||
* {1,4}->{1,3}->{1,3}
|
||||
* Varies from {4,10}->{6,12}->{8,1}->{10,1}->
|
||||
* {3,3}->{2,2}->{1,2}->
|
||||
* {1,4}->{1,3}->{1,3}
|
||||
*/
|
||||
#define TWO_NTESTS 9
|
||||
int two_tests[TWO_NTESTS][2] = { {2, 2}, {2, -11}, {2, 0},
|
||||
{-7, 2}, {-1, -1}, {-1, 0},
|
||||
{0, 2}, {0, -1}, {0, 0}
|
||||
};
|
||||
{0, 2}, {0, -1}, {0, 0}
|
||||
};
|
||||
|
||||
static herr_t extend_dset_two(const char *file, char *dname);
|
||||
static herr_t extend_dset_one(const char *file, char *dname);
|
||||
@ -87,7 +86,7 @@ typedef struct set_t {
|
||||
***********************************************************************
|
||||
*
|
||||
* Extending a two-dimensional dataset:
|
||||
* dims[0] dims[1]
|
||||
* dims[0] dims[1]
|
||||
* ------- -------
|
||||
* case #1: increase increase
|
||||
* case #2: increase decrease
|
||||
@ -99,12 +98,12 @@ typedef struct set_t {
|
||||
* case #8: same decrease (no action)
|
||||
* case #9: same same (no action)
|
||||
*
|
||||
* two_tests[TWO_NTESTS][2] = { {2,2}, {2,-11}, {2,0},
|
||||
* two_tests[TWO_NTESTS][2] = { {2,2}, {2,-11}, {2,0},
|
||||
* {-7,2}, {-1,-1}, {-1,0},
|
||||
* {0,2}, {0,-1}, {0,0} }
|
||||
* varies from {4,10}->{6,12}->{8,1}->{10,1}->
|
||||
* {3,3}->{2,2}->{1,2}->
|
||||
* {1,4}->{1,3}->{1,3}
|
||||
* varies from {4,10}->{6,12}->{8,1}->{10,1}->
|
||||
* {3,3}->{2,2}->{1,2}->
|
||||
* {1,4}->{1,3}->{1,3}
|
||||
***********************************************************************
|
||||
*/
|
||||
static herr_t
|
||||
@ -172,7 +171,7 @@ extend_dset_two(const char *file, char *dname)
|
||||
/* sleep to emulate about 2 seconds of application operation */
|
||||
HDsleep(2);
|
||||
|
||||
/* Get current dimension sizes */
|
||||
/* Get current dimension sizes */
|
||||
if(H5LDget_dset_dims(did, cur_dims) < 0)
|
||||
goto error;
|
||||
|
||||
@ -187,7 +186,7 @@ extend_dset_two(const char *file, char *dname)
|
||||
num_elmts = 1;
|
||||
for(j = 0; j < (unsigned)ndims; j++)
|
||||
num_elmts *= (unsigned)ext_dims[j];
|
||||
|
||||
|
||||
/* Compound type */
|
||||
if(!HDstrcmp(dname, DSET_CMPD_TWO)) {
|
||||
|
||||
@ -254,15 +253,15 @@ error:
|
||||
***********************************************************************
|
||||
*
|
||||
* Extending a one-dimensional dataset
|
||||
* Test cases:
|
||||
* #1: increase
|
||||
* #2: decrease
|
||||
* #3: same
|
||||
* #4: decrease
|
||||
* #5: increase
|
||||
* Test cases:
|
||||
* #1: increase
|
||||
* #2: decrease
|
||||
* #3: same
|
||||
* #4: decrease
|
||||
* #5: increase
|
||||
*
|
||||
* one_tests[ONE_NTESTS] = {3, -1, 0, -11, 2}
|
||||
* varies from 10->13->12->12->1->3
|
||||
* one_tests[ONE_NTESTS] = {3, -1, 0, -11, 2}
|
||||
* varies from 10->13->12->12->1->3
|
||||
*
|
||||
***********************************************************************
|
||||
*/
|
||||
@ -441,13 +440,13 @@ main(int argc, const char *argv[])
|
||||
dname = HDstrdup(argv[2]);
|
||||
|
||||
if(!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) {
|
||||
if(extend_dset_one(fname, dname) < 0)
|
||||
if(extend_dset_one(fname, dname) < 0)
|
||||
goto error;
|
||||
} else if(!HDstrcmp(dname, DSET_ONE) || !HDstrcmp(dname, DSET_ALLOC_LATE) || !HDstrcmp(dname, DSET_ALLOC_EARLY)) {
|
||||
if(extend_dset_one(fname, dname) < 0)
|
||||
if(extend_dset_one(fname, dname) < 0)
|
||||
goto error;
|
||||
} else if(!HDstrcmp(dname, DSET_TWO) || !HDstrcmp(dname, DSET_CMPD_TWO)) {
|
||||
if(extend_dset_two(fname, dname) < 0)
|
||||
if(extend_dset_two(fname, dname) < 0)
|
||||
goto error;
|
||||
} else {
|
||||
HDfprintf(stdout, "Dataset cannot be extended...\n");
|
||||
|
Loading…
Reference in New Issue
Block a user