diff options
Diffstat (limited to 'hl/test')
-rw-r--r-- | hl/test/CMakeLists.txt | 36 | ||||
-rw-r--r-- | hl/test/gen_test_ds.c | 2 | ||||
-rw-r--r-- | hl/test/h5hltest.h | 8 | ||||
-rw-r--r-- | hl/test/pal_rgb.h | 298 | ||||
-rw-r--r-- | hl/test/test_ds.c | 26 | ||||
-rw-r--r-- | hl/test/test_dset_append.c | 4 | ||||
-rw-r--r-- | hl/test/test_file_image.c | 4 | ||||
-rw-r--r-- | hl/test/test_image.c | 4 | ||||
-rw-r--r-- | hl/test/test_ld.c | 10 | ||||
-rw-r--r-- | hl/test/test_lite.c | 36 | ||||
-rw-r--r-- | hl/test/test_packet.c | 2 | ||||
-rw-r--r-- | hl/test/test_table.c | 4 |
12 files changed, 333 insertions, 101 deletions
diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt index 6349bb3..b63004e 100644 --- a/hl/test/CMakeLists.txt +++ b/hl/test/CMakeLists.txt @@ -20,7 +20,7 @@ configure_file (${HDF5_HL_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ON macro (HL_ADD_EXE hl_name) add_executable (hl_${hl_name} ${hl_name}.c) target_compile_options(hl_${hl_name} PRIVATE "${HDF5_CMAKE_C_FLAGS}") - target_include_directories (hl_${hl_name} PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (hl_${hl_name} PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (hl_${hl_name} STATIC) target_link_libraries (hl_${hl_name} PRIVATE @@ -37,6 +37,13 @@ macro (HL_ADD_EXE hl_name) ) endif () set_target_properties (hl_${hl_name} PROPERTIES FOLDER test/hl) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_HL_TEST_${hl_name}_FORMAT hl_${hl_name}) + endif () endmacro () HL_ADD_EXE (test_lite) @@ -51,7 +58,7 @@ HL_ADD_EXE (test_h5do_compat) # test_packet has two source files add_executable (hl_test_packet test_packet.c test_packet_vlen.c) target_compile_options(hl_test_packet PRIVATE "${HDF5_CMAKE_C_FLAGS}") -target_include_directories (hl_test_packet PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (hl_test_packet PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (hl_test_packet STATIC) target_link_libraries (hl_test_packet PRIVATE @@ -69,6 +76,13 @@ else () endif () set_target_properties (hl_test_packet PROPERTIES FOLDER test/hl) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_HL_TEST_hl_test_packet_FORMAT hl_test_packet) +endif () + # -------------------------------------------------------------------- # This executable is used to generate test files for the test_ds test. # It should only be run during development when new test files are needed @@ -76,7 +90,7 @@ set_target_properties (hl_test_packet PROPERTIES FOLDER test/hl) if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) add_executable (hl_gen_test_ds gen_test_ds.c) target_compile_options(hl_gen_test_ds PRIVATE "${HDF5_CMAKE_C_FLAGS}") - target_include_directories (hl_gen_test_ds PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (hl_gen_test_ds PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (hl_gen_test_ds STATIC) target_link_libraries (hl_gen_test_ds PRIVATE ${HDF5_HL_LIB_TARGET} @@ -85,9 +99,16 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) ) set_target_properties (hl_gen_test_ds PROPERTIES FOLDER test/hl/gen) + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_HL_TEST_hl_gen_test_ds_FORMAT hl_gen_test_ds) + endif () + add_executable (hl_gen_test_ld gen_test_ld.c) target_compile_options(hl_gen_test_ld PRIVATE "${HDF5_CMAKE_C_FLAGS}") - target_include_directories (hl_gen_test_ld PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (hl_gen_test_ld PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (hl_gen_test_ld STATIC) target_link_libraries (hl_gen_test_ld PRIVATE ${HDF5_HL_LIB_TARGET} @@ -95,6 +116,13 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) ${HDF5_LIB_TARGET} ) set_target_properties (hl_gen_test_ld PROPERTIES FOLDER test/hl/gen) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_HL_TEST_hl_gen_test_ld_FORMAT hl_gen_test_ld) + endif () endif () if (HDF5_TEST_SERIAL) diff --git a/hl/test/gen_test_ds.c b/hl/test/gen_test_ds.c index c3fc7ff..368c083 100644 --- a/hl/test/gen_test_ds.c +++ b/hl/test/gen_test_ds.c @@ -23,8 +23,6 @@ * in test_ds.c will read them. */ -#include <stdlib.h> -#include <string.h> #include "h5hltest.h" #include "H5DSpublic.h" #include "H5LTpublic.h" diff --git a/hl/test/h5hltest.h b/hl/test/h5hltest.h index d286c00..14f3e14 100644 --- a/hl/test/h5hltest.h +++ b/hl/test/h5hltest.h @@ -12,14 +12,14 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu> + * Programmer: Quincey Koziol * Friday, April 28, 2006 * * Purpose: Test support stuff. */ -#ifndef _H5HLTEST_H -#define _H5HLTEST_H +#ifndef H5HLTEST_H +#define H5HLTEST_H /* Get the HDF5 test header */ #include "h5test.h" @@ -48,4 +48,4 @@ int test_packet_table_with_varlen(void); -#endif /* _H5HLTEST_H */ +#endif /* H5HLTEST_H */ diff --git a/hl/test/pal_rgb.h b/hl/test/pal_rgb.h index 0d0ffcc..a2b17e2 100644 --- a/hl/test/pal_rgb.h +++ b/hl/test/pal_rgb.h @@ -11,41 +11,263 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -const unsigned char pal_rgb[256 * 3] = { - 255, 255, 255, 0, 0, 131, 0, 0, 135, 0, 0, 139, 0, 0, 143, 0, 0, 147, 0, 0, 151, - 0, 0, 155, 0, 0, 159, 0, 0, 163, 0, 0, 167, 0, 0, 171, 0, 0, 175, 0, 0, 179, - 0, 0, 183, 0, 0, 187, 0, 0, 191, 0, 0, 195, 0, 0, 199, 0, 0, 203, 0, 0, 207, - 0, 0, 211, 0, 0, 215, 0, 0, 219, 0, 0, 223, 0, 0, 227, 0, 0, 231, 0, 0, 235, - 0, 0, 239, 0, 0, 243, 0, 0, 247, 0, 0, 251, 0, 0, 255, 0, 0, 255, 0, 3, 255, - 0, 7, 255, 0, 11, 255, 0, 15, 255, 0, 19, 255, 0, 23, 255, 0, 27, 255, 0, 31, 255, - 0, 35, 255, 0, 39, 255, 0, 43, 255, 0, 47, 255, 0, 51, 255, 0, 55, 255, 0, 59, 255, - 0, 63, 255, 0, 67, 255, 0, 71, 255, 0, 75, 255, 0, 79, 255, 0, 83, 255, 0, 87, 255, - 0, 91, 255, 0, 95, 255, 0, 99, 255, 0, 103, 255, 0, 107, 255, 0, 111, 255, 0, 115, 255, - 0, 119, 255, 0, 123, 255, 0, 127, 255, 0, 131, 255, 0, 135, 255, 0, 139, 255, 0, 143, 255, - 0, 147, 255, 0, 151, 255, 0, 155, 255, 0, 159, 255, 0, 163, 255, 0, 167, 255, 0, 171, 255, - 0, 175, 255, 0, 179, 255, 0, 183, 255, 0, 187, 255, 0, 191, 255, 0, 195, 255, 0, 199, 255, - 0, 203, 255, 0, 207, 255, 0, 211, 255, 0, 215, 255, 0, 219, 255, 0, 223, 255, 0, 227, 255, - 0, 231, 255, 0, 235, 255, 0, 239, 255, 0, 243, 255, 0, 247, 255, 0, 251, 255, 0, 255, 255, - 0, 255, 255, 3, 255, 251, 7, 255, 247, 11, 255, 243, 15, 255, 239, 19, 255, 235, 23, 255, 231, - 27, 255, 227, 31, 255, 223, 35, 255, 219, 39, 255, 215, 43, 255, 211, 47, 255, 207, 51, 255, 203, - 55, 255, 199, 59, 255, 195, 63, 255, 191, 67, 255, 187, 71, 255, 183, 75, 255, 179, 79, 255, 175, - 83, 255, 171, 87, 255, 167, 91, 255, 163, 95, 255, 159, 99, 255, 155, 103, 255, 151, 107, 255, 147, - 111, 255, 143, 115, 255, 139, 119, 255, 135, 123, 255, 131, 127, 255, 127, 131, 255, 123, 135, 255, 119, - 139, 255, 115, 143, 255, 111, 147, 255, 107, 151, 255, 103, 155, 255, 99, 159, 255, 95, 163, 255, 91, - 167, 255, 87, 171, 255, 83, 175, 255, 79, 179, 255, 75, 183, 255, 71, 187, 255, 67, 191, 255, 63, - 195, 255, 59, 199, 255, 55, 203, 255, 51, 207, 255, 47, 211, 255, 43, 215, 255, 39, 219, 255, 35, - 223, 255, 31, 227, 255, 27, 231, 255, 23, 235, 255, 19, 239, 255, 15, 243, 255, 11, 247, 255, 7, - 251, 255, 3, 255, 255, 0, 255, 251, 0, 255, 247, 0, 255, 243, 0, 255, 239, 0, 255, 235, 0, - 255, 231, 0, 255, 227, 0, 255, 223, 0, 255, 219, 0, 255, 215, 0, 255, 211, 0, 255, 207, 0, - 255, 203, 0, 255, 199, 0, 255, 195, 0, 255, 191, 0, 255, 187, 0, 255, 183, 0, 255, 179, 0, - 255, 175, 0, 255, 171, 0, 255, 167, 0, 255, 163, 0, 255, 159, 0, 255, 155, 0, 255, 151, 0, - 255, 147, 0, 255, 143, 0, 255, 139, 0, 255, 135, 0, 255, 131, 0, 255, 127, 0, 255, 123, 0, - 255, 119, 0, 255, 115, 0, 255, 111, 0, 255, 107, 0, 255, 103, 0, 255, 99, 0, 255, 95, 0, - 255, 91, 0, 255, 87, 0, 255, 83, 0, 255, 79, 0, 255, 75, 0, 255, 71, 0, 255, 67, 0, - 255, 63, 0, 255, 59, 0, 255, 55, 0, 255, 51, 0, 255, 47, 0, 255, 43, 0, 255, 39, 0, - 255, 35, 0, 255, 31, 0, 255, 27, 0, 255, 23, 0, 255, 19, 0, 255, 15, 0, 255, 11, 0, - 255, 7, 0, 255, 3, 0, 255, 0, 0, 250, 0, 0, 246, 0, 0, 241, 0, 0, 237, 0, 0, - 233, 0, 0, 228, 0, 0, 224, 0, 0, 219, 0, 0, 215, 0, 0, 211, 0, 0, 206, 0, 0, - 202, 0, 0, 197, 0, 0, 193, 0, 0, 189, 0, 0, 184, 0, 0, 180, 0, 0, 175, 0, 0, - 171, 0, 0, 167, 0, 0, 162, 0, 0, 158, 0, 0, 153, 0, 0, 149, 0, 0, 145, 0, 0, - 140, 0, 0, 136, 0, 0, 131, 0, 0, 127, 0, 0}; +/* clang-format off */ +const unsigned char pal_rgb[256*3] = { + 255,255,255, + 0,0,131, + 0,0,135, + 0,0,139, + 0,0,143, + 0,0,147, + 0,0,151, + 0,0,155, + 0,0,159, + 0,0,163, + 0,0,167, + 0,0,171, + 0,0,175, + 0,0,179, + 0,0,183, + 0,0,187, + 0,0,191, + 0,0,195, + 0,0,199, + 0,0,203, + 0,0,207, + 0,0,211, + 0,0,215, + 0,0,219, + 0,0,223, + 0,0,227, + 0,0,231, + 0,0,235, + 0,0,239, + 0,0,243, + 0,0,247, + 0,0,251, + 0,0,255, + 0,0,255, + 0,3,255, + 0,7,255, + 0,11,255, + 0,15,255, + 0,19,255, + 0,23,255, + 0,27,255, + 0,31,255, + 0,35,255, + 0,39,255, + 0,43,255, + 0,47,255, + 0,51,255, + 0,55,255, + 0,59,255, + 0,63,255, + 0,67,255, + 0,71,255, + 0,75,255, + 0,79,255, + 0,83,255, + 0,87,255, + 0,91,255, + 0,95,255, + 0,99,255, + 0,103,255, + 0,107,255, + 0,111,255, + 0,115,255, + 0,119,255, + 0,123,255, + 0,127,255, + 0,131,255, + 0,135,255, + 0,139,255, + 0,143,255, + 0,147,255, + 0,151,255, + 0,155,255, + 0,159,255, + 0,163,255, + 0,167,255, + 0,171,255, + 0,175,255, + 0,179,255, + 0,183,255, + 0,187,255, + 0,191,255, + 0,195,255, + 0,199,255, + 0,203,255, + 0,207,255, + 0,211,255, + 0,215,255, + 0,219,255, + 0,223,255, + 0,227,255, + 0,231,255, + 0,235,255, + 0,239,255, + 0,243,255, + 0,247,255, + 0,251,255, + 0,255,255, + 0,255,255, + 3,255,251, + 7,255,247, + 11,255,243, + 15,255,239, + 19,255,235, + 23,255,231, + 27,255,227, + 31,255,223, + 35,255,219, + 39,255,215, + 43,255,211, + 47,255,207, + 51,255,203, + 55,255,199, + 59,255,195, + 63,255,191, + 67,255,187, + 71,255,183, + 75,255,179, + 79,255,175, + 83,255,171, + 87,255,167, + 91,255,163, + 95,255,159, + 99,255,155, + 103,255,151, + 107,255,147, + 111,255,143, + 115,255,139, + 119,255,135, + 123,255,131, + 127,255,127, + 131,255,123, + 135,255,119, + 139,255,115, + 143,255,111, + 147,255,107, + 151,255,103, + 155,255,99, + 159,255,95, + 163,255,91, + 167,255,87, + 171,255,83, + 175,255,79, + 179,255,75, + 183,255,71, + 187,255,67, + 191,255,63, + 195,255,59, + 199,255,55, + 203,255,51, + 207,255,47, + 211,255,43, + 215,255,39, + 219,255,35, + 223,255,31, + 227,255,27, + 231,255,23, + 235,255,19, + 239,255,15, + 243,255,11, + 247,255,7, + 251,255,3, + 255,255,0, + 255,251,0, + 255,247,0, + 255,243,0, + 255,239,0, + 255,235,0, + 255,231,0, + 255,227,0, + 255,223,0, + 255,219,0, + 255,215,0, + 255,211,0, + 255,207,0, + 255,203,0, + 255,199,0, + 255,195,0, + 255,191,0, + 255,187,0, + 255,183,0, + 255,179,0, + 255,175,0, + 255,171,0, + 255,167,0, + 255,163,0, + 255,159,0, + 255,155,0, + 255,151,0, + 255,147,0, + 255,143,0, + 255,139,0, + 255,135,0, + 255,131,0, + 255,127,0, + 255,123,0, + 255,119,0, + 255,115,0, + 255,111,0, + 255,107,0, + 255,103,0, + 255,99,0, + 255,95,0, + 255,91,0, + 255,87,0, + 255,83,0, + 255,79,0, + 255,75,0, + 255,71,0, + 255,67,0, + 255,63,0, + 255,59,0, + 255,55,0, + 255,51,0, + 255,47,0, + 255,43,0, + 255,39,0, + 255,35,0, + 255,31,0, + 255,27,0, + 255,23,0, + 255,19,0, + 255,15,0, + 255,11,0, + 255,7,0, + 255,3,0, + 255,0,0, + 250,0,0, + 246,0,0, + 241,0,0, + 237,0,0, + 233,0,0, + 228,0,0, + 224,0,0, + 219,0,0, + 215,0,0, + 211,0,0, + 206,0,0, + 202,0,0, + 197,0,0, + 193,0,0, + 189,0,0, + 184,0,0, + 180,0,0, + 175,0,0, + 171,0,0, + 167,0,0, + 162,0,0, + 158,0,0, + 153,0,0, + 149,0,0, + 145,0,0, + 140,0,0, + 136,0,0, + 131,0,0, + 127,0,0 +}; +/* clang-format on */ diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c index 47fd02d..ead5c65 100644 --- a/hl/test/test_ds.c +++ b/hl/test/test_ds.c @@ -11,8 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include <stdlib.h> -#include <string.h> #include "h5hltest.h" #include "H5srcdir.h" #include "H5DSpublic.h" @@ -3556,9 +3554,9 @@ verify_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_data) int ret = 0; /* unused */ - dset = dset; - dim = dim; - visitor_data = visitor_data; + (void)dset; + (void)dim; + (void)visitor_data; /* define a positive value for return value. This will cause the iterator to immediately return that positive value, indicating short-circuit success @@ -3604,8 +3602,8 @@ read_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_data) char * data = (char *)visitor_data; /* unused */ - dset = dset; - dim = dim; + (void)dset; + (void)dim; /* get space */ if ((sid = H5Dget_space(scale_id)) < 0) @@ -3693,7 +3691,7 @@ match_dim_scale(hid_t did, unsigned dim, hid_t dsid, void *visitor_data) hsize_t storage_size; /* Stop compiler from whining about "unused parameters" */ - visitor_data = visitor_data; + (void)visitor_data; /*------------------------------------------------------------------------- * get DID (dataset) space info @@ -3771,9 +3769,9 @@ static herr_t op_continue(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_data) { /* Stop compiler from whining about "unused parameters" */ - dset = dset; - dim = dim; - scale_id = scale_id; + (void)dset; + (void)dim; + (void)scale_id; if (visitor_data != NULL) { (*(int *)visitor_data)++; @@ -3804,9 +3802,9 @@ static herr_t op_stop(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_data) { /* Stop compiler from whining about "unused parameters" */ - dset = dset; - dim = dim; - scale_id = scale_id; + (void)dset; + (void)dim; + (void)scale_id; if (visitor_data != NULL) { (*(int *)visitor_data)++; diff --git a/hl/test/test_dset_append.c b/hl/test/test_dset_append.c index 53bd4b0..3b11c2b 100644 --- a/hl/test/test_dset_append.c +++ b/hl/test/test_dset_append.c @@ -11,10 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include <math.h> -#include <stdlib.h> -#include <string.h> - #include "h5hltest.h" #include "H5DOpublic.h" diff --git a/hl/test/test_file_image.c b/hl/test/test_file_image.c index 11b9d39..b397a81 100644 --- a/hl/test/test_file_image.c +++ b/hl/test/test_file_image.c @@ -51,7 +51,7 @@ *------------------------------------------------------------------------- */ static int -test_file_image(size_t open_images, size_t nflags, unsigned *flags) +test_file_image(size_t open_images, size_t nflags, const unsigned *flags) { hid_t * file_id, *dset_id, file_space, plist; /* HDF5 ids */ hsize_t dims1[RANK] = {2, 3}; /* original dimension of datasets */ @@ -509,6 +509,8 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags) } /* end for */ /* release temporary working buffers */ + for (i = 0; i < open_images; i++) + HDfree(filename[i]); HDfree(filename); HDfree(file_id); HDfree(dset_id); diff --git a/hl/test/test_image.c b/hl/test/test_image.c index f6967b3..0c7d511 100644 --- a/hl/test/test_image.c +++ b/hl/test/test_image.c @@ -11,10 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include <limits.h> -#include <stdlib.h> -#include <string.h> - #include "h5hltest.h" #include "H5srcdir.h" #include "H5LTpublic.h" diff --git a/hl/test/test_ld.c b/hl/test/test_ld.c index 880e78e..dc5755c 100644 --- a/hl/test/test_ld.c +++ b/hl/test/test_ld.c @@ -11,11 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include <stdlib.h> -#include <string.h> -#include <stdio.h> -#include <errno.h> -#include <setjmp.h> #include "h5hltest.h" #include "H5srcdir.h" #include "H5LDpublic.h" @@ -162,7 +157,8 @@ static herr_t test_LD_elmts_invalid(const char *file); static herr_t test_LD_elmts_one(const char *file, const char *dname, const char *fields); static herr_t test_LD_elmts_two(const char *file, const char *dname, const char *fields); -static herr_t verify_elmts_two(int type, hsize_t *ext_dims, hsize_t *prev_dims, void *_ldbuf, void *_buf); +static herr_t verify_elmts_two(int type, const hsize_t *ext_dims, const hsize_t *prev_dims, void *_ldbuf, + void *_buf); /* data structures for compound data type */ typedef struct sub22_t { @@ -1152,7 +1148,7 @@ error: ************************************************************************************** */ static herr_t -verify_elmts_two(int type, hsize_t *ext_dims, hsize_t *prev_dims, void *_ldbuf, void *_buf) +verify_elmts_two(int type, const hsize_t *ext_dims, const hsize_t *prev_dims, void *_ldbuf, void *_buf) { int k, m; /* Local index variable */ diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index 02316c9..cae91ff 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -11,8 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include <stdlib.h> -#include <string.h> #include "h5hltest.h" #include "H5srcdir.h" #include "H5LTpublic.h" @@ -1056,7 +1054,7 @@ test_integers(void) HDfree(dt_str); goto out; } - if (HDstrcmp(dt_str, "H5T_STD_I8BE")) { + if (HDstrcmp(dt_str, "H5T_STD_I8BE") != 0) { HDfree(dt_str); goto out; } @@ -1114,7 +1112,7 @@ test_fps(void) HDfree(dt_str); goto out; } - if (HDstrcmp(dt_str, "H5T_IEEE_F32BE")) { + if (HDstrcmp(dt_str, "H5T_IEEE_F32BE") != 0) { HDfree(dt_str); goto out; } @@ -1186,7 +1184,7 @@ test_strings(void) goto out; } if (HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE 13;\n STRPAD H5T_STR_NULLTERM;\n CSET " - "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }")) { + "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }") != 0) { HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); goto out; @@ -1221,7 +1219,7 @@ test_strings(void) goto out; } if (HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n " - "CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }")) { + "CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }") != 0) { HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); goto out; @@ -1240,7 +1238,7 @@ test_strings(void) if (HDstrncmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET " "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }", - str_len - 1)) { + str_len - 1) != 0) { HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); goto out; @@ -1263,7 +1261,7 @@ test_strings(void) if (HDstrncmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET " "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }", - str_len)) { + str_len) != 0) { HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); goto out; @@ -1324,7 +1322,8 @@ test_opaques(void) } if (HDstrcmp( dt_str, - "H5T_OPAQUE {\n OPQ_SIZE 19;\n OPQ_TAG \"This is a tag for opaque type\";\n }")) { + "H5T_OPAQUE {\n OPQ_SIZE 19;\n OPQ_TAG \"This is a tag for opaque type\";\n }") != + 0) { HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); goto out; @@ -1378,7 +1377,7 @@ test_enums(void) if (H5Tenum_nameof(dtype, &value1, name1, size) < 0) goto out; - if (HDstrcmp(name1, "BLUE")) + if (HDstrcmp(name1, "BLUE") != 0) goto out; if (H5Tenum_valueof(dtype, name2, &value2) < 0) @@ -1401,8 +1400,9 @@ test_enums(void) HDfree(dt_str); goto out; } - if (HDstrcmp(dt_str, "H5T_ENUM {\n H5T_STD_I32LE;\n \"RED\" 5;\n \"GREEN\" " - " 6;\n \"BLUE\" 7;\n \"WHITE\" 8;\n }")) { + if (HDstrcmp(dt_str, + "H5T_ENUM {\n H5T_STD_I32LE;\n \"RED\" 5;\n \"GREEN\" " + " 6;\n \"BLUE\" 7;\n \"WHITE\" 8;\n }") != 0) { HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); @@ -1464,7 +1464,7 @@ test_variables(void) HDfree(dt_str); goto out; } - if (HDstrcmp(dt_str, "H5T_VLEN {\n H5T_VLEN {\n H5T_STD_I32BE\n }\n }")) { + if (HDstrcmp(dt_str, "H5T_VLEN {\n H5T_VLEN {\n H5T_STD_I32BE\n }\n }") != 0) { HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); goto out; @@ -1528,7 +1528,7 @@ test_arrays(void) } if (HDstrcmp(dt_str, "H5T_ARRAY {\n [5][7][13] H5T_ARRAY {\n [17][19] H5T_COMPOUND {\n " " H5T_STD_I8BE \"arr_compound_1\" : 0;\n H5T_STD_I32BE " - "\"arr_compound_2\" : 1;\n }\n }\n }")) { + "\"arr_compound_2\" : 1;\n }\n }\n }") != 0) { HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); goto out; @@ -1588,7 +1588,7 @@ test_compounds(void) goto out; } if (HDstrcmp(dt_str, "H5T_COMPOUND {\n H5T_STD_I16BE \"one_field\" : 2;\n H5T_STD_U8LE " - "\"two_field\" : 6;\n }")) { + "\"two_field\" : 6;\n }") != 0) { HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); goto out; @@ -1607,7 +1607,7 @@ test_compounds(void) if ((memb_name = H5Tget_member_name(dtype, 1)) == NULL) goto out; - if (HDstrcmp(memb_name, "i16_field")) { + if (HDstrcmp(memb_name, "i16_field") != 0) { H5free_memory(memb_name); goto out; } @@ -1685,7 +1685,7 @@ test_compound_bug(void) if ((memb_name = H5Tget_member_name(dtype, 2)) == NULL) goto out; - if (HDstrcmp(memb_name, "sub")) { + if (HDstrcmp(memb_name, "sub") != 0) { H5free_memory(memb_name); goto out; } @@ -1722,7 +1722,7 @@ test_compound_bug(void) if ((memb_name = H5Tget_member_name(dtype, 1)) == NULL) goto out; if (HDstrcmp(memb_name, "desc____________________________________________________________________________" - "_____________")) { + "_____________") != 0) { H5free_memory(memb_name); goto out; } diff --git a/hl/test/test_packet.c b/hl/test/test_packet.c index 6ff70dc..1d3a569 100644 --- a/hl/test/test_packet.c +++ b/hl/test/test_packet.c @@ -11,8 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include <stdlib.h> -#include <string.h> #include "h5hltest.h" #include "H5PTpublic.h" #include "H5TBpublic.h" diff --git a/hl/test/test_table.c b/hl/test/test_table.c index b462ec1..0d4a72a 100644 --- a/hl/test/test_table.c +++ b/hl/test/test_table.c @@ -11,8 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include <stdlib.h> -#include <string.h> #include "h5hltest.h" #include "H5srcdir.h" #include "H5TBpublic.h" @@ -1274,7 +1272,7 @@ test_table(hid_t fid, int do_write) /* write the new longitude and latitude information to all the records */ nfields = 2; start = 0; - nrecords = NRECORDS; + nrecords = NRECORDS_ADD; if (H5TBwrite_fields_index(fid, "table12", nfields, field_index_pos, start, nrecords, sizeof(position_t), field_offset_pos, field_sizes_pos, position_in) < 0) goto out; |