From 44e2ddac97a6bae4637ef040c9f1a9f7b70978f3 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 30 Jul 2019 12:39:20 -0500 Subject: Merge cleanup mostly whitespace --- CTestConfig.cmake | 2 +- config/cmake/scripts/HDF5config.cmake | 2 +- java/test/TestH5P.java | 2 +- java/test/TestH5Pfapl.java | 3 - java/test/TestH5Z.java | 1 - test/direct_chunk.c | 178 ++-- test/dsets.c | 245 +++--- test/dt_arith.c | 1460 ++++++++++++++++----------------- test/earray.c | 4 +- test/th5o.c | 32 +- test/titerate.c | 2 +- 11 files changed, 963 insertions(+), 968 deletions(-) diff --git a/CTestConfig.cmake b/CTestConfig.cmake index d80f48f..4868d07 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -50,5 +50,5 @@ set (CTEST_TEST_TIMEOUT 1200 CACHE STRING set (DART_TESTING_TIMEOUT 1200 CACHE STRING "Maximum time allowed before CTest will kill the test." FORCE) -SET(CTEST_SUBMIT_RETRY_DELAY 20 CACHE STRING +set (CTEST_SUBMIT_RETRY_DELAY 20 CACHE STRING "How long to wait between timed-out CTest submissions.") diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index e6c9619..3511d05 100644 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -45,7 +45,7 @@ set (CTEST_SOURCE_VERSEXT "") #CTEST_SOURCE_NAME - name of source folder; HDF5-1.10.0 #MODEL - CDash group name #HPC - run alternate configurations for HPC machines; sbatch, bsub, raybsub, qsub -#MPI - enable MPI; +#MPI - enable MPI if (DEFINED CTEST_SCRIPT_ARG) # transform ctest script arguments of the form # script.ctest,var1=value1,var2=value2 diff --git a/java/test/TestH5P.java b/java/test/TestH5P.java index a85405b..b1c29b2 100644 --- a/java/test/TestH5P.java +++ b/java/test/TestH5P.java @@ -209,7 +209,7 @@ public class TestH5P { @Test(expected = HDF5FunctionArgumentException.class) public void testH5Pset_libver_bounds_invalidlow() throws Throwable { - H5.H5Pset_libver_bounds(fapl_id, HDF5Constants.H5F_LIBVER_EARLIEST-1, HDF5Constants.H5F_LIBVER_LATEST); + H5.H5Pset_libver_bounds(fapl_id, HDF5Constants.H5F_LIBVER_LATEST+1, HDF5Constants.H5F_LIBVER_LATEST); } @Test(expected = HDF5FunctionArgumentException.class) diff --git a/java/test/TestH5Pfapl.java b/java/test/TestH5Pfapl.java index 81a7ecb..7d690cf 100644 --- a/java/test/TestH5Pfapl.java +++ b/java/test/TestH5Pfapl.java @@ -29,8 +29,6 @@ import hdf.hdf5lib.exceptions.HDF5Exception; import hdf.hdf5lib.exceptions.HDF5LibraryException; import hdf.hdf5lib.exceptions.HDF5PropertyListInterfaceException; import hdf.hdf5lib.structs.H5AC_cache_config_t; -import hdf.hdf5lib.structs.H5FD_hdfs_fapl_t; -import hdf.hdf5lib.structs.H5FD_ros3_fapl_t; import org.junit.After; import org.junit.Before; @@ -1401,5 +1399,4 @@ public class TestH5Pfapl { fail("H5P_evict_on_close: " + err); } } - } diff --git a/java/test/TestH5Z.java b/java/test/TestH5Z.java index f3049ed..27bda6f 100644 --- a/java/test/TestH5Z.java +++ b/java/test/TestH5Z.java @@ -109,4 +109,3 @@ public class TestH5Z { H5.H5Zunregister(HDF5Constants.H5Z_FILTER_SHUFFLE); } } - diff --git a/test/direct_chunk.c b/test/direct_chunk.c index 9ea814c..447e827 100644 --- a/test/direct_chunk.c +++ b/test/direct_chunk.c @@ -13,7 +13,7 @@ #include "h5test.h" -#if defined(H5_HAVE_ZLIB_H) && !defined(H5_ZLIB_HEADER) +#if defined(H5_HAVE_ZLIB_H) && !defined(H5_ZLIB_HEADER) # define H5_ZLIB_HEADER "zlib.h" #endif #if defined(H5_ZLIB_HEADER) @@ -46,10 +46,10 @@ #define DEFLATE_SIZE_ADJUST(s) (HDceil(((double)(s))*H5_DOUBLE(1.001))+H5_DOUBLE(12.0)) /* Temporary filter IDs used for testing */ -#define H5Z_FILTER_BOGUS1 305 -#define H5Z_FILTER_BOGUS2 306 -#define ADD_ON 7 -#define FACTOR 3 +#define H5Z_FILTER_BOGUS1 305 +#define H5Z_FILTER_BOGUS2 306 +#define ADD_ON 7 +#define FACTOR 3 /* Constants for the overwrite test */ #define OVERWRITE_NDIMS 3 @@ -83,33 +83,33 @@ static size_t filter_bogus2(unsigned int flags, size_t cd_nelmts, /* This message derives from H5Z */ const H5Z_class2_t H5Z_BOGUS1[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_BOGUS1, /* Filter id number */ + H5Z_FILTER_BOGUS1, /* Filter id number */ 1, 1, /* Encoding and decoding enabled */ - "bogus1", /* Filter name for debugging */ + "bogus1", /* Filter name for debugging */ NULL, /* The "can apply" callback */ NULL, /* The "set local" callback */ - filter_bogus1, /* The actual filter function */ + filter_bogus1, /* The actual filter function */ }}; const H5Z_class2_t H5Z_BOGUS2[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_BOGUS2, /* Filter id number */ + H5Z_FILTER_BOGUS2, /* Filter id number */ 1, 1, /* Encoding and decoding enabled */ - "bogus2", /* Filter name for debugging */ + "bogus2", /* Filter name for debugging */ NULL, /* The "can apply" callback */ NULL, /* The "set local" callback */ - filter_bogus2, /* The actual filter function */ + filter_bogus2, /* The actual filter function */ }}; /*------------------------------------------------------------------------- - * Function: test_direct_chunk_write + * Function: test_direct_chunk_write * - * Purpose: Test the basic functionality of H5Dwrite_chunk + * Purpose: Test the basic functionality of H5Dwrite_chunk * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * 30 November 2012 * *------------------------------------------------------------------------- @@ -121,7 +121,7 @@ test_direct_chunk_write (hid_t file) hid_t dataspace = -1, dataset = -1; hid_t mem_space = -1; hid_t cparms = -1, dxpl = -1; - hsize_t dims[2] = {NX, NY}; + hsize_t dims[2] = {NX, NY}; hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; hsize_t chunk_dims[2] ={CHUNK_NX, CHUNK_NY}; herr_t status; @@ -136,11 +136,11 @@ test_direct_chunk_write (hid_t file) size_t buf_size = CHUNK_NX*CHUNK_NY*sizeof(int); const Bytef *z_src = (const Bytef*)(direct_buf); - Bytef *z_dst = NULL; /*destination buffer */ - uLongf z_dst_nbytes = (uLongf)DEFLATE_SIZE_ADJUST(buf_size); - uLong z_src_nbytes = (uLong)buf_size; + Bytef *z_dst = NULL; /*destination buffer */ + uLongf z_dst_nbytes = (uLongf)DEFLATE_SIZE_ADJUST(buf_size); + uLong z_src_nbytes = (uLong)buf_size; int aggression = 9; /* Compression aggression setting */ - void *outbuf = NULL; /* Pointer to new buffer */ + void *outbuf = NULL; /* Pointer to new buffer */ hsize_t start[2]; /* Start of hyperslab */ hsize_t stride[2]; /* Stride of hyperslab */ @@ -175,29 +175,29 @@ test_direct_chunk_write (hid_t file) * creation properties. */ if((dataset = H5Dcreate2(file, DATASETNAME1, H5T_NATIVE_INT, dataspace, H5P_DEFAULT, - cparms, H5P_DEFAULT)) < 0) + cparms, H5P_DEFAULT)) < 0) goto error; /* Initialize the dataset */ for(i = n = 0; i < NX; i++) for(j = 0; j < NY; j++) - data[i][j] = n++; + data[i][j] = n++; if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error; /* * Write the data for the dataset. It should stay in the chunk cache. - * It will be evicted from the cache by the H5Dwrite_chunk calls. + * It will be evicted from the cache by the H5Dwrite_chunk calls. */ if((status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, - dxpl, data)) < 0) + dxpl, data)) < 0) goto error; /* Initialize data for one chunk */ for(i = n = 0; i < CHUNK_NX; i++) for(j = 0; j < CHUNK_NY; j++) - direct_buf[i][j] = n++; + direct_buf[i][j] = n++; /* Allocate output (compressed) buffer */ outbuf = HDmalloc(z_dst_nbytes); @@ -218,8 +218,8 @@ test_direct_chunk_write (hid_t file) goto error; } - /* Write the compressed chunk data repeatedly to cover all the chunks in the - * dataset, using the direct writing function. */ + /* Write the compressed chunk data repeatedly to cover all the chunks in the + * dataset, using the direct writing function. */ for(i=0; i H5Fset_dset_no_attrs_hint(file, TRUE)) + /* Create the file for this test */ + if((file = H5Fcreate(filename, H5F_ACC_TRUNC, my_fcpl, my_fapl)) < 0) goto error; - puts("(minimized dataset object headers with file setting)"); - } - /* Cause the library to emit initial messages */ - if((grp = H5Gcreate2(file, "emit diagnostics", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - goto error; - if(H5Oset_comment(grp, "Causes diagnostic messages to be emitted") < 0) - goto error; - if(H5Gclose(grp) < 0) - goto error; + if (TRUE == minimized_ohdr) { + if (0 > H5Fset_dset_no_attrs_hint(file, TRUE)) + goto error; + puts("(minimized dataset object headers with file setting)"); + } - nerrors += (test_create(file) < 0 ? 1 : 0); - nerrors += (test_simple_io(envval, my_fapl) < 0 ? 1 : 0); - nerrors += (test_compact_io(my_fapl) < 0 ? 1 : 0); - nerrors += (test_max_compact(my_fapl) < 0 ? 1 : 0); - nerrors += (test_compact_open_close_dirty(my_fapl) < 0 ? 1 : 0); - nerrors += (test_conv_buffer(file) < 0 ? 1 : 0); - nerrors += (test_tconv(file) < 0 ? 1 : 0); - nerrors += (test_filters(file, my_fapl) < 0 ? 1 : 0); - nerrors += (test_onebyte_shuffle(file) < 0 ? 1 : 0); - nerrors += (test_nbit_int(file) < 0 ? 1 : 0); - nerrors += (test_nbit_float(file) < 0 ? 1 : 0); - nerrors += (test_nbit_double(file) < 0 ? 1 : 0); - nerrors += (test_nbit_array(file) < 0 ? 1 : 0); - nerrors += (test_nbit_compound(file) < 0 ? 1 : 0); - nerrors += (test_nbit_compound_2(file) < 0 ? 1 : 0); - nerrors += (test_nbit_compound_3(file) < 0 ? 1 : 0); - nerrors += (test_nbit_int_size(file) < 0 ? 1 : 0); - nerrors += (test_nbit_flt_size(file) < 0 ? 1 : 0); - nerrors += (test_scaleoffset_int(file) < 0 ? 1 : 0); - nerrors += (test_scaleoffset_int_2(file) < 0 ? 1 : 0); - nerrors += (test_scaleoffset_float(file) < 0 ? 1 : 0); - nerrors += (test_scaleoffset_float_2(file) < 0 ? 1 : 0); - nerrors += (test_scaleoffset_double(file) < 0 ? 1 : 0); - nerrors += (test_scaleoffset_double_2(file) < 0 ? 1 : 0); - nerrors += (test_multiopen (file) < 0 ? 1 : 0); - nerrors += (test_types(file) < 0 ? 1 : 0); - nerrors += (test_userblock_offset(envval, my_fapl, new_format) < 0 ? 1 : 0); - nerrors += (test_missing_filter(file) < 0 ? 1 : 0); - nerrors += (test_can_apply(file) < 0 ? 1 : 0); - nerrors += (test_can_apply2(file) < 0 ? 1 : 0); - nerrors += (test_set_local(my_fapl) < 0 ? 1 : 0); - nerrors += (test_can_apply_szip(file) < 0 ? 1 : 0); - nerrors += (test_compare_dcpl(file) < 0 ? 1 : 0); - nerrors += (test_copy_dcpl(file, my_fapl) < 0 ? 1 : 0); - nerrors += (test_filter_delete(file) < 0 ? 1 : 0); - nerrors += (test_filters_endianess() < 0 ? 1 : 0); - nerrors += (test_zero_dims(file) < 0 ? 1 : 0); - nerrors += (test_missing_chunk(file) < 0 ? 1 : 0); - nerrors += (test_random_chunks(my_fapl) < 0 ? 1 : 0); + /* Cause the library to emit initial messages */ + if((grp = H5Gcreate2(file, "emit diagnostics", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; + if(H5Oset_comment(grp, "Causes diagnostic messages to be emitted") < 0) + goto error; + if(H5Gclose(grp) < 0) + goto error; + + nerrors += (test_create(file) < 0 ? 1 : 0); + nerrors += (test_simple_io(envval, my_fapl) < 0 ? 1 : 0); + nerrors += (test_compact_io(my_fapl) < 0 ? 1 : 0); + nerrors += (test_max_compact(my_fapl) < 0 ? 1 : 0); + nerrors += (test_compact_open_close_dirty(my_fapl) < 0 ? 1 : 0); + nerrors += (test_conv_buffer(file) < 0 ? 1 : 0); + nerrors += (test_tconv(file) < 0 ? 1 : 0); + nerrors += (test_filters(file, my_fapl) < 0 ? 1 : 0); + nerrors += (test_onebyte_shuffle(file) < 0 ? 1 : 0); + nerrors += (test_nbit_int(file) < 0 ? 1 : 0); + nerrors += (test_nbit_float(file) < 0 ? 1 : 0); + nerrors += (test_nbit_double(file) < 0 ? 1 : 0); + nerrors += (test_nbit_array(file) < 0 ? 1 : 0); + nerrors += (test_nbit_compound(file) < 0 ? 1 : 0); + nerrors += (test_nbit_compound_2(file) < 0 ? 1 : 0); + nerrors += (test_nbit_compound_3(file) < 0 ? 1 : 0); + nerrors += (test_nbit_int_size(file) < 0 ? 1 : 0); + nerrors += (test_nbit_flt_size(file) < 0 ? 1 : 0); + nerrors += (test_scaleoffset_int(file) < 0 ? 1 : 0); + nerrors += (test_scaleoffset_int_2(file) < 0 ? 1 : 0); + nerrors += (test_scaleoffset_float(file) < 0 ? 1 : 0); + nerrors += (test_scaleoffset_float_2(file) < 0 ? 1 : 0); + nerrors += (test_scaleoffset_double(file) < 0 ? 1 : 0); + nerrors += (test_scaleoffset_double_2(file) < 0 ? 1 : 0); + nerrors += (test_multiopen (file) < 0 ? 1 : 0); + nerrors += (test_types(file) < 0 ? 1 : 0); + nerrors += (test_userblock_offset(envval, my_fapl, new_format) < 0 ? 1 : 0); + nerrors += (test_missing_filter(file) < 0 ? 1 : 0); + nerrors += (test_can_apply(file) < 0 ? 1 : 0); + nerrors += (test_can_apply2(file) < 0 ? 1 : 0); + nerrors += (test_set_local(my_fapl) < 0 ? 1 : 0); + nerrors += (test_can_apply_szip(file) < 0 ? 1 : 0); + nerrors += (test_compare_dcpl(file) < 0 ? 1 : 0); + nerrors += (test_copy_dcpl(file, my_fapl) < 0 ? 1 : 0); + nerrors += (test_filter_delete(file) < 0 ? 1 : 0); + nerrors += (test_filters_endianess() < 0 ? 1 : 0); + nerrors += (test_zero_dims(file) < 0 ? 1 : 0); + nerrors += (test_missing_chunk(file) < 0 ? 1 : 0); + nerrors += (test_random_chunks(my_fapl) < 0 ? 1 : 0); #ifndef H5_NO_DEPRECATED_SYMBOLS - nerrors += (test_deprec(file) < 0 ? 1 : 0); + nerrors += (test_deprec(file) < 0 ? 1 : 0); #endif /* H5_NO_DEPRECATED_SYMBOLS */ - nerrors += (test_huge_chunks(my_fapl) < 0 ? 1 : 0); - nerrors += (test_chunk_cache(my_fapl) < 0 ? 1 : 0); - nerrors += (test_big_chunks_bypass_cache(my_fapl) < 0 ? 1 : 0); - nerrors += (test_chunk_fast(envval, my_fapl) < 0 ? 1 : 0); - nerrors += (test_reopen_chunk_fast(my_fapl) < 0 ? 1 : 0); - nerrors += (test_chunk_fast_bug1(my_fapl) < 0 ? 1 : 0); - nerrors += (test_chunk_expand(my_fapl) < 0 ? 1 : 0); - nerrors += (test_layout_extend(my_fapl) < 0 ? 1 : 0); - nerrors += (test_fixed_array(my_fapl) < 0 ? 1 : 0); - nerrors += (test_idx_compatible() < 0 ? 1 : 0); - nerrors += (test_unfiltered_edge_chunks(my_fapl) < 0 ? 1 : 0); - nerrors += (test_single_chunk(my_fapl) < 0 ? 1 : 0); - nerrors += (test_large_chunk_shrink(my_fapl) < 0 ? 1 : 0); - nerrors += (test_zero_dim_dset(my_fapl) < 0 ? 1 : 0); - nerrors += (test_storage_size(my_fapl) < 0 ? 1 : 0); - nerrors += (test_power2up(my_fapl) < 0 ? 1 : 0); - - nerrors += (test_swmr_non_latest(envval, my_fapl) < 0 ? 1 : 0); - nerrors += (test_earray_hdr_fd(envval, my_fapl) < 0 ? 1 : 0); - nerrors += (test_farray_hdr_fd(envval, my_fapl) < 0 ? 1 : 0); - nerrors += (test_bt2_hdr_fd(envval, my_fapl) < 0 ? 1 : 0); - - if(H5Fclose(file) < 0) - goto error; - } /* end for new_format */ - } /* for minimized dset object headers */ + nerrors += (test_huge_chunks(my_fapl) < 0 ? 1 : 0); + nerrors += (test_chunk_cache(my_fapl) < 0 ? 1 : 0); + nerrors += (test_big_chunks_bypass_cache(my_fapl) < 0 ? 1 : 0); + nerrors += (test_chunk_fast(envval, my_fapl) < 0 ? 1 : 0); + nerrors += (test_reopen_chunk_fast(my_fapl) < 0 ? 1 : 0); + nerrors += (test_chunk_fast_bug1(my_fapl) < 0 ? 1 : 0); + nerrors += (test_chunk_expand(my_fapl) < 0 ? 1 : 0); + nerrors += (test_layout_extend(my_fapl) < 0 ? 1 : 0); + nerrors += (test_fixed_array(my_fapl) < 0 ? 1 : 0); + nerrors += (test_idx_compatible() < 0 ? 1 : 0); + nerrors += (test_unfiltered_edge_chunks(my_fapl) < 0 ? 1 : 0); + nerrors += (test_single_chunk(my_fapl) < 0 ? 1 : 0); + nerrors += (test_large_chunk_shrink(my_fapl) < 0 ? 1 : 0); + nerrors += (test_zero_dim_dset(my_fapl) < 0 ? 1 : 0); + nerrors += (test_storage_size(my_fapl) < 0 ? 1 : 0); + nerrors += (test_power2up(my_fapl) < 0 ? 1 : 0); + + nerrors += (test_swmr_non_latest(envval, my_fapl) < 0 ? 1 : 0); + nerrors += (test_earray_hdr_fd(envval, my_fapl) < 0 ? 1 : 0); + nerrors += (test_farray_hdr_fd(envval, my_fapl) < 0 ? 1 : 0); + nerrors += (test_bt2_hdr_fd(envval, my_fapl) < 0 ? 1 : 0); + + if(H5Fclose(file) < 0) + goto error; + } /* end for new_format */ + } /* end for minimized_ohdr */ } /* end for paged */ /* Close property lists */ @@ -13363,7 +13368,7 @@ main(void) nerrors += (test_gather_error() < 0 ? 1 : 0); /* Tests version bounds using its own file */ - nerrors += (test_versionbounds() < 0 ? 1 : 0); + nerrors += (test_versionbounds() < 0 ? 1 : 0); nerrors += (test_object_header_minimization_dcpl() < 0 ? 1 : 0); diff --git a/test/dt_arith.c b/test/dt_arith.c index 645608b..7e1adf5 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -21,7 +21,7 @@ #include "h5test.h" /* Number of elements in each random test */ -#define NTESTELEM 10000 +#define NTESTELEM 10000 /* Epsilon for floating-point comparisons */ #define FP_EPSILON 0.000001F @@ -30,7 +30,7 @@ * Offset from alinged memory returned by malloc(). This can be used to test * that type conversions handle non-aligned buffers correctly. */ -#define ALIGNMENT 1 +#define ALIGNMENT 1 /* * Define if you want to test alignment code on a machine that doesn't @@ -41,7 +41,7 @@ /* Alignment test stuff */ #ifdef TEST_ALIGNMENT -#define H5T_FRIEND /*suppress error about including H5Tpkg */ +#define H5T_FRIEND /*suppress error about including H5Tpkg */ #include "H5Tpkg.h" #endif #define SET_ALIGNMENT(TYPE,VAL) \ @@ -58,7 +58,7 @@ const char *FILENAME[] = { * endian. If local variable `endian' is H5T_ORDER_BE then the result will * be I, otherwise the result will be Z-(I+1). */ -#define ENDIAN(Z,I,E) (H5T_ORDER_BE==E?(I):(Z)-((I)+1)) +#define ENDIAN(Z,I,E) (H5T_ORDER_BE==E?(I):(Z)-((I)+1)) typedef enum dtype_t { INT_SCHAR, INT_UCHAR, INT_SHORT, INT_USHORT, INT_INT, INT_UINT, @@ -100,8 +100,8 @@ static int skip_overflow_tests_g = 0; static int without_hardware_g = 0; /* Allocates memory aligned on a certain boundary. */ -#define aligned_malloc(Z) ((void*)((char*)HDmalloc(ALIGNMENT+Z)+ALIGNMENT)) -#define aligned_free(M) HDfree((char*)(M)-ALIGNMENT) +#define aligned_malloc(Z) ((void*)((char*)HDmalloc(ALIGNMENT+Z)+ALIGNMENT)) +#define aligned_free(M) HDfree((char*)(M)-ALIGNMENT) /* Initialize source buffer of integer for integer->integer and integer->floating-point conversion test. * This algorithm is mainly to avoid any casting and comparison between source and destination types @@ -394,13 +394,13 @@ static int my_isinf(int endian, unsigned char *val, size_t size, size_t mpos, size_t msize, size_t epos, size_t esize); /*------------------------------------------------------------------------- - * Function: fpe_handler + * Function: fpe_handler * - * Purpose: Exit with 255 + * Purpose: Exit with 255 * - * Return: void + * Return: void * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, July 6, 1998 * * Modifications: @@ -419,16 +419,16 @@ fpe_handler(int H5_ATTR_UNUSED signo) HDexit(255); } - + /*------------------------------------------------------------------------- - * Function: reset_hdf5 + * Function: reset_hdf5 * - * Purpose: Reset the hdf5 library. This causes statistics to be printed - * and counters to be reset. + * Purpose: Reset the hdf5 library. This causes statistics to be printed + * and counters to be reset. * - * Return: void + * Return: void * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, November 16, 1998 * * Modifications: @@ -461,19 +461,19 @@ reset_hdf5(void) } - + /*------------------------------------------------------------------------- - * Function: except_func + * Function: except_func * - * Purpose: Gets called for all data type conversion exceptions. + * Purpose: Gets called for all data type conversion exceptions. * - * Return: H5T_CONV_ABORT: -1 + * Return: H5T_CONV_ABORT: -1 * * H5T_CONV_UNHANDLED 0 * * H5T_CONV_HANDLED 1 * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * April 19, 2004 * * Modifications: @@ -482,7 +482,7 @@ reset_hdf5(void) */ static H5T_conv_ret_t except_func(H5T_conv_except_t except_type, hid_t H5_ATTR_UNUSED src_id, hid_t H5_ATTR_UNUSED dst_id, void H5_ATTR_UNUSED *src_buf, - void *dst_buf, void *user_data) + void *dst_buf, void *user_data) { H5T_conv_ret_t ret = H5T_CONV_HANDLED; @@ -509,19 +509,19 @@ except_func(H5T_conv_except_t except_type, hid_t H5_ATTR_UNUSED src_id, hid_t H5 return ret; } - + /*------------------------------------------------------------------------- - * Function: some_dummy_func + * Function: some_dummy_func * - * Purpose: A dummy function to help check for overflow. + * Purpose: A dummy function to help check for overflow. * - * Note: DO NOT DECLARE THIS FUNCTION STATIC OR THE COMPILER MIGHT - * PROMOTE ARGUMENT `x' TO DOUBLE AND DEFEAT THE OVERFLOW - * CHECKING. + * Note: DO NOT DECLARE THIS FUNCTION STATIC OR THE COMPILER MIGHT + * PROMOTE ARGUMENT `x' TO DOUBLE AND DEFEAT THE OVERFLOW + * CHECKING. * - * Return: void + * Return: void * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, July 21, 1998 * *------------------------------------------------------------------------- @@ -529,21 +529,21 @@ except_func(H5T_conv_except_t except_type, hid_t H5_ATTR_UNUSED src_id, hid_t H5 void some_dummy_func(float x) { - char s[128]; + char s[128]; HDsnprintf(s, sizeof(s), "%g", (double)x); } - + /*------------------------------------------------------------------------- - * Function: generates_sigfpe + * Function: generates_sigfpe * - * Purpose: Determines if SIGFPE is generated from overflows. We must be - * able to fork() and waitpid() in order for this test to work - * properly. Sets skip_overflow_tests_g to non-zero if they - * would generate SIGBUS, zero otherwise. + * Purpose: Determines if SIGFPE is generated from overflows. We must be + * able to fork() and waitpid() in order for this test to work + * properly. Sets skip_overflow_tests_g to non-zero if they + * would generate SIGBUS, zero otherwise. * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, July 21, 1998 * * Modifications: @@ -554,38 +554,38 @@ static void generates_sigfpe(void) { #if defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID) - pid_t pid; - int status; - size_t i, j; - double d; + pid_t pid; + int status; + size_t i, j; + double d; unsigned char *dp = (unsigned char*)&d; - float f; + float f; HDfflush(stdout); HDfflush(stderr); if ((pid=fork()) < 0) { - HDperror("fork"); - HDexit(EXIT_FAILURE); + HDperror("fork"); + HDexit(EXIT_FAILURE); } else if (0==pid) { - for (i=0; i<2000; i++) { - for(j = 0; j < sizeof(double); j++) + for (i=0; i<2000; i++) { + for(j = 0; j < sizeof(double); j++) dp[j] = (unsigned char)HDrand(); - f = (float)d; - some_dummy_func((float)f); - } - HDexit(EXIT_SUCCESS); + f = (float)d; + some_dummy_func((float)f); + } + HDexit(EXIT_SUCCESS); } while (pid!=waitpid(pid, &status, 0)) /*void*/; if (WIFEXITED(status) && 0==WEXITSTATUS(status)) { - HDputs("Floating-point overflow cases will be tested."); - skip_overflow_tests_g = FALSE; + HDputs("Floating-point overflow cases will be tested."); + skip_overflow_tests_g = FALSE; } else if (WIFSIGNALED(status) && SIGFPE==WTERMSIG(status)) { - HDputs("Floating-point overflow cases cannot be safely tested."); - skip_overflow_tests_g = TRUE; - /* delete the core dump file that SIGFPE may have created */ - HDunlink("core"); + HDputs("Floating-point overflow cases cannot be safely tested."); + skip_overflow_tests_g = TRUE; + /* delete the core dump file that SIGFPE may have created */ + HDunlink("core"); } #else HDputs("Cannot determine if floating-point overflows generate a SIGFPE;"); @@ -595,7 +595,7 @@ generates_sigfpe(void) #endif } - + /*------------------------------------------------------------------------- * Function: test_hard_query * @@ -621,7 +621,7 @@ test_hard_query(void) /* Verify the conversion from int to float is a hard conversion. */ if(H5Tcompiler_conv(H5T_NATIVE_INT, H5T_NATIVE_FLOAT) != TRUE) { H5_FAILED(); - printf("Can't query conversion function\n"); + HDprintf("Can't query conversion function\n"); goto error; } @@ -630,7 +630,7 @@ test_hard_query(void) H5Tunregister(H5T_PERS_HARD, NULL, H5T_NATIVE_INT, H5T_NATIVE_FLOAT, (H5T_conv_t)((void (*) (void))H5T__conv_int_float)); if(H5Tcompiler_conv(H5T_NATIVE_INT, H5T_NATIVE_FLOAT) != FALSE) { H5_FAILED(); - printf("Can't query conversion function\n"); + HDprintf("Can't query conversion function\n"); goto error; } @@ -639,7 +639,7 @@ test_hard_query(void) H5Tregister(H5T_PERS_HARD, "int_flt", H5T_NATIVE_INT, H5T_NATIVE_FLOAT, (H5T_conv_t)((void (*) (void))H5T__conv_int_float)); if(H5Tcompiler_conv(H5T_NATIVE_INT, H5T_NATIVE_FLOAT) != TRUE) { H5_FAILED(); - printf("Can't query conversion function\n"); + HDprintf("Can't query conversion function\n"); goto error; } @@ -660,16 +660,16 @@ error: return 1; } - + /*------------------------------------------------------------------------- - * Function: expt_handle + * Function: expt_handle * - * Purpose: Gets called from test_particular_fp_integer() for data type + * Purpose: Gets called from test_particular_fp_integer() for data type * conversion exceptions. * - * Return: H5T_CONV_HANDLED 1 + * Return: H5T_CONV_HANDLED 1 * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Sept 7, 2005 * * Modifications: @@ -678,7 +678,7 @@ error: */ static H5T_conv_ret_t expt_handle(H5T_conv_except_t except_type, hid_t H5_ATTR_UNUSED src_id, hid_t H5_ATTR_UNUSED dst_id, void H5_ATTR_UNUSED *src_buf, - void *dst_buf, void *user_data) + void *dst_buf, void *user_data) { signed char fill_value1 = 7; int fill_value2 = 13; @@ -694,7 +694,7 @@ expt_handle(H5T_conv_except_t except_type, hid_t H5_ATTR_UNUSED src_id, hid_t H5 return H5T_CONV_HANDLED; } - + /*------------------------------------------------------------------------- * Function: test_particular_fp_integer * @@ -714,12 +714,6 @@ expt_handle(H5T_conv_except_t except_type, hid_t H5_ATTR_UNUSED src_id, hid_t H5 * Return: Success: 0 * * Failure: number of errors - * - * Programmer: Raymond Lu - * Sept 7, 2005 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int test_particular_fp_integer(void) @@ -735,7 +729,7 @@ static int test_particular_fp_integer(void) float src_f = (float)INT_MAX; int dst_i; int fill_value = 13; - int endian; /*endianess */ + int endian; /*endianess */ unsigned int fails_this_test = 0; size_t j; @@ -743,7 +737,7 @@ static int test_particular_fp_integer(void) if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) { H5_FAILED(); - printf("Can't create data transfer property list\n"); + HDprintf("Can't create data transfer property list\n"); goto error; } @@ -754,25 +748,25 @@ static int test_particular_fp_integer(void) buf1 = (unsigned char*)HDcalloc((size_t)1, (size_t)MAX(src_size1, dst_size1)); saved_buf1 = (unsigned char*)HDcalloc((size_t)1, (size_t)MAX(src_size1, dst_size1)); - memcpy(buf1, &src_d, src_size1); - memcpy(saved_buf1, &src_d, src_size1); + HDmemcpy(buf1, &src_d, src_size1); + HDmemcpy(saved_buf1, &src_d, src_size1); /* Register exception handling function and signal the destination is "signed char". */ flag = 1; if(H5Pset_type_conv_cb(dxpl_id, expt_handle, &flag) < 0) { H5_FAILED(); - printf("Can't register conversion callback\n"); + HDprintf("Can't register conversion callback\n"); goto error; } /* Do conversion */ if(H5Tconvert(H5T_NATIVE_DOUBLE, H5T_NATIVE_SCHAR, (size_t)1, buf1, NULL, dxpl_id) < 0) { H5_FAILED(); - printf("Can't convert data\n"); + HDprintf("Can't convert data\n"); goto error; } - memcpy(&dst_c, buf1, dst_size1); + HDmemcpy(&dst_c, buf1, dst_size1); /* Print errors */ if(dst_c != SCHAR_MAX) { @@ -782,20 +776,20 @@ static int test_particular_fp_integer(void) if(0 == fails_this_test++) H5_FAILED(); - printf(" test double to signed char:\n"); - printf(" src = "); + HDprintf(" test double to signed char:\n"); + HDprintf(" src = "); for (j=0; j derived floating-point conversions"); - printf("%-70s", str); - HDfflush(stdout); + HDsnprintf(str, sizeof(str), "\nTesting random sw derived floating-point -> derived floating-point conversions"); + HDprintf("%-70s", str); + HDfflush(stdout); H5_FAILED(); } - printf(" test %u elmt %u: \n", 1, (unsigned)i); + HDprintf(" test %u elmt %u: \n", 1, (unsigned)i); - printf(" src = "); + HDprintf(" src = "); for (j=0; j=max_fails) { HDputs(" maximum failures reached, aborting test..."); @@ -1127,43 +1121,43 @@ test_derived_flt(void) *--------------------------------------------------------------------------*/ if(H5Tset_fields(tid2, (size_t)23, (size_t)16, (size_t)7, (size_t)0, (size_t)16) < 0) { H5_FAILED(); - printf("Can't set fields\n"); + HDprintf("Can't set fields\n"); goto error; } if(H5Tset_offset(tid2, (size_t)0) < 0) { H5_FAILED(); - printf("Can't set offset\n"); + HDprintf("Can't set offset\n"); goto error; } if(H5Tset_precision(tid2, (size_t)24) < 0) { H5_FAILED(); - printf("Can't set precision 2\n"); + HDprintf("Can't set precision 2\n"); goto error; } if(H5Tset_size(tid2, (size_t)3) < 0) { H5_FAILED(); - printf("Can't set size\n"); + HDprintf("Can't set size\n"); goto error; } if(H5Tset_ebias(tid2, (size_t)63) < 0) { H5_FAILED(); - printf("Can't set size\n"); + HDprintf("Can't set size\n"); goto error; } if(H5Tset_pad(tid2, H5T_PAD_ZERO, H5T_PAD_ZERO) < 0) { H5_FAILED(); - printf("Can't set padding\n"); + HDprintf("Can't set padding\n"); goto error; } if(H5Tcommit2(file, "new float type 2", tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) { H5_FAILED(); - printf("Can't set inpad\n"); + HDprintf("Can't set inpad\n"); goto error; } if(H5Tclose(tid2) < 0) { H5_FAILED(); - printf("Can't close datatype\n"); + HDprintf("Can't close datatype\n"); goto error; } @@ -1171,33 +1165,33 @@ test_derived_flt(void) FAIL_PUTS_ERROR("Can't open datatype") if(H5Tget_fields(tid2, &spos, &epos, &esize, &mpos, &msize) < 0) { H5_FAILED(); - printf("Can't get fields\n"); + HDprintf("Can't get fields\n"); goto error; } if(spos != 23 || epos != 16 || esize != 7 || mpos != 0 || msize != 16) { H5_FAILED(); - printf("Wrong field values\n"); + HDprintf("Wrong field values\n"); goto error; } if(H5Tget_precision(tid2) != 24) { H5_FAILED(); - printf("Can't get precision or wrong precision\n"); + HDprintf("Can't get precision or wrong precision\n"); goto error; } if(H5Tget_offset(tid2)!=0) { H5_FAILED(); - printf("Can't get offset or wrong offset\n"); + HDprintf("Can't get offset or wrong offset\n"); goto error; } if((size = H5Tget_size(tid2))!=3) { H5_FAILED(); - printf("Can't get size or wrong size\n"); + HDprintf("Can't get size or wrong size\n"); goto error; } if(H5Tget_ebias(tid2)!=63) { H5_FAILED(); - printf("Can't get exponent bias or wrong bias\n"); + HDprintf("Can't get exponent bias or wrong bias\n"); goto error; } @@ -1221,13 +1215,13 @@ test_derived_flt(void) * the precision and exponent power. */ if(H5Tconvert(tid2, tid1, nelmts, buf, NULL, dxpl_id) < 0) { H5_FAILED(); - printf("Can't convert data\n"); + HDprintf("Can't convert data\n"); goto error; } /* Convert data from the 1st back to the 2nd derived floating-point type. */ if(H5Tconvert(tid1, tid2, nelmts, buf, NULL, dxpl_id) < 0) { H5_FAILED(); - printf("Can't convert data\n"); + HDprintf("Can't convert data\n"); goto error; } @@ -1249,22 +1243,22 @@ test_derived_flt(void) /* Print errors */ if (0==fails_this_test++) { - HDsnprintf(str, sizeof(str), "\nTesting random sw derived floating-point -> derived floating-point conversions"); - printf("%-70s", str); - HDfflush(stdout); + HDsnprintf(str, sizeof(str), "\nTesting random sw derived floating-point -> derived floating-point conversions"); + HDprintf("%-70s", str); + HDfflush(stdout); H5_FAILED(); } - printf(" test %u elmt %u: \n", 1, (unsigned)i); + HDprintf(" test %u elmt %u: \n", 1, (unsigned)i); - printf(" src = "); + HDprintf(" src = "); for (j=0; j=max_fails) { HDputs(" maximum failures reached, aborting test..."); @@ -1277,25 +1271,25 @@ test_derived_flt(void) if(H5Tclose(tid1) < 0) { H5_FAILED(); - printf("Can't close datatype\n"); + HDprintf("Can't close datatype\n"); goto error; } if(H5Tclose(tid2) < 0) { H5_FAILED(); - printf("Can't close datatype\n"); + HDprintf("Can't close datatype\n"); goto error; } if(H5Pclose(dxpl_id) < 0) { H5_FAILED(); - printf("Can't close property list\n"); + HDprintf("Can't close property list\n"); goto error; } if(H5Fclose(file) < 0) { H5_FAILED(); - printf("Can't close file\n"); + HDprintf("Can't close file\n"); goto error; } /* end if */ @@ -1304,7 +1298,7 @@ test_derived_flt(void) /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); - reset_hdf5(); /*print statistics*/ + reset_hdf5(); /*print statistics*/ return 0; @@ -1328,7 +1322,7 @@ test_derived_flt(void) return MAX((int)fails_this_test, 1); } - + /*------------------------------------------------------------------------- * Function: test_derived_integer * @@ -1353,11 +1347,11 @@ test_derived_integer(void) char filename[1024]; size_t src_size, dst_size; unsigned char *buf=NULL, *saved_buf=NULL; - int endian; /*endianess */ + int endian; /*endianess */ size_t nelmts = NTESTELEM; unsigned int fails_this_test = 0; - const size_t max_fails=40; /*max number of failures*/ - char str[256]; /*message string */ + const size_t max_fails=40; /*max number of failures*/ + char str[256]; /*message string */ unsigned int i, j; TESTING("user-define and query functions of integer types"); @@ -1366,25 +1360,25 @@ test_derived_integer(void) h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof filename); if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) { H5_FAILED(); - printf("Can't create file\n"); + HDprintf("Can't create file\n"); goto error; } if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) { H5_FAILED(); - printf("Can't create data transfer property list\n"); + HDprintf("Can't create data transfer property list\n"); goto error; } if((tid1 = H5Tcopy(H5T_STD_I32LE)) < 0) { H5_FAILED(); - printf("Can't copy data type\n"); + HDprintf("Can't copy data type\n"); goto error; } if((tid2 = H5Tcopy(H5T_STD_U64LE)) < 0) { H5_FAILED(); - printf("Can't copy data type\n"); + HDprintf("Can't copy data type\n"); goto error; } @@ -1402,37 +1396,37 @@ test_derived_integer(void) *--------------------------------------------------------------------------*/ if(H5Tset_offset(tid1, (size_t)0) < 0) { H5_FAILED(); - printf("Can't set offset\n"); + HDprintf("Can't set offset\n"); goto error; } if(H5Tset_size(tid1, (size_t)3) < 0) { H5_FAILED(); - printf("Can't set size\n"); + HDprintf("Can't set size\n"); goto error; } if(H5Tset_precision(tid1, (size_t)24) < 0) { H5_FAILED(); - printf("Can't set precision\n"); + HDprintf("Can't set precision\n"); goto error; } if(H5Tset_order(tid1, H5T_ORDER_BE) < 0) { H5_FAILED(); - printf("Can't set order\n"); + HDprintf("Can't set order\n"); goto error; } if(H5Tcommit2(file, "new integer type 1", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) { H5_FAILED(); - printf("Can't commit data type\n"); + HDprintf("Can't commit data type\n"); goto error; } if(H5Tclose(tid1) < 0) { H5_FAILED(); - printf("Can't close datatype\n"); + HDprintf("Can't close datatype\n"); goto error; } @@ -1440,22 +1434,22 @@ test_derived_integer(void) FAIL_PUTS_ERROR("Can't open datatype") if(H5Tget_precision(tid1) != 24) { H5_FAILED(); - printf("Can't get precision or wrong precision\n"); + HDprintf("Can't get precision or wrong precision\n"); goto error; } if(H5Tget_offset(tid1) != 0) { H5_FAILED(); - printf("Can't get offset or wrong offset\n"); + HDprintf("Can't get offset or wrong offset\n"); goto error; } if(H5Tget_size(tid1) != 3) { H5_FAILED(); - printf("Can't get size or wrong size\n"); + HDprintf("Can't get size or wrong size\n"); goto error; } if(H5Tget_order(tid1)!=H5T_ORDER_BE) { H5_FAILED(); - printf("Can't get order or wrong order\n"); + HDprintf("Can't get order or wrong order\n"); goto error; } @@ -1469,31 +1463,31 @@ test_derived_integer(void) *--------------------------------------------------------------------------*/ if(H5Tset_precision(tid2, (size_t)48) < 0) { H5_FAILED(); - printf("Can't set precision\n"); + HDprintf("Can't set precision\n"); goto error; } if(H5Tset_offset(tid2, (size_t)10) < 0) { H5_FAILED(); - printf("Can't set offset\n"); + HDprintf("Can't set offset\n"); goto error; } if(H5Tset_sign(tid2, H5T_SGN_2) < 0) { H5_FAILED(); - printf("Can't set offset\n"); + HDprintf("Can't set offset\n"); goto error; } if(H5Tcommit2(file, "new integer type 2", tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) { H5_FAILED(); - printf("Can't commit data type\n"); + HDprintf("Can't commit data type\n"); goto error; } if(H5Tclose(tid2) < 0) { H5_FAILED(); - printf("Can't close datatype\n"); + HDprintf("Can't close datatype\n"); goto error; } @@ -1501,22 +1495,22 @@ test_derived_integer(void) FAIL_PUTS_ERROR("Can't open datatype") if(H5Tget_precision(tid2) != 48) { H5_FAILED(); - printf("Can't get precision or wrong precision\n"); + HDprintf("Can't get precision or wrong precision\n"); goto error; } if(H5Tget_offset(tid2) != 10) { H5_FAILED(); - printf("Can't get offset or wrong offset\n"); + HDprintf("Can't get offset or wrong offset\n"); goto error; } if(H5Tget_size(tid2) != 8) { H5_FAILED(); - printf("Can't get size or wrong size\n"); + HDprintf("Can't get size or wrong size\n"); goto error; } if(H5Tget_sign(tid2)!=H5T_SGN_2) { H5_FAILED(); - printf("Can't get sign or wrong sign\n"); + HDprintf("Can't get sign or wrong sign\n"); goto error; } @@ -1540,13 +1534,13 @@ test_derived_integer(void) * the 1st type's precision. */ if(H5Tconvert(tid1, tid2, nelmts, buf, NULL, dxpl_id) < 0) { H5_FAILED(); - printf("Can't convert data\n"); + HDprintf("Can't convert data\n"); goto error; } /* Convert data from the 2nd back to the 1st derived integer type. */ if(H5Tconvert(tid2, tid1, nelmts, buf, NULL, dxpl_id) < 0) { H5_FAILED(); - printf("Can't convert data\n"); + HDprintf("Can't convert data\n"); goto error; } @@ -1560,22 +1554,22 @@ test_derived_integer(void) /* Print errors */ if (0==fails_this_test++) { - HDsnprintf(str, sizeof(str), "\nTesting random sw derived integer -> derived integer conversions"); - printf("%-70s", str); - HDfflush(stdout); + HDsnprintf(str, sizeof(str), "\nTesting random sw derived integer -> derived integer conversions"); + HDprintf("%-70s", str); + HDfflush(stdout); H5_FAILED(); } - printf(" test %u elmt %u: \n", 1, (unsigned)i); + HDprintf(" test %u elmt %u: \n", 1, (unsigned)i); - printf(" src = "); + HDprintf(" src = "); for (j=0; j=max_fails) { HDputs(" maximum failures reached, aborting test..."); @@ -1585,25 +1579,25 @@ test_derived_integer(void) if(H5Tclose(tid1) < 0) { H5_FAILED(); - printf("Can't close datatype\n"); + HDprintf("Can't close datatype\n"); goto error; } if(H5Tclose(tid2) < 0) { H5_FAILED(); - printf("Can't close datatype\n"); + HDprintf("Can't close datatype\n"); goto error; } if(H5Pclose(dxpl_id) < 0) { H5_FAILED(); - printf("Can't close property list\n"); + HDprintf("Can't close property list\n"); goto error; } if(H5Fclose(file) < 0) { H5_FAILED(); - printf("Can't close file\n"); + HDprintf("Can't close file\n"); goto error; } /* end if */ @@ -1615,7 +1609,7 @@ test_derived_integer(void) /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); - reset_hdf5(); /*print statistics*/ + reset_hdf5(); /*print statistics*/ return 0; @@ -1638,24 +1632,24 @@ test_derived_integer(void) return MAX((int)fails_this_test, 1); } - + /*------------------------------------------------------------------------- - * Function: test_conv_int_1 + * Function: test_conv_int_1 * - * Purpose: Test conversion of integer values from SRC to DST. - * These types should be any combination of: + * Purpose: Test conversion of integer values from SRC to DST. + * These types should be any combination of: * - * H5T_NATIVE_SCHAR H5T_NATIVE_UCHAR - * H5T_NATIVE_SHORT H5T_NATIVE_USHORT - * H5T_NATIVE_INT H5T_NATIVE_UINT - * H5T_NATIVE_LONG H5T_NATIVE_ULONG - * H5T_NATIVE_LLONG H5T_NATIVE_ULLONG + * H5T_NATIVE_SCHAR H5T_NATIVE_UCHAR + * H5T_NATIVE_SHORT H5T_NATIVE_USHORT + * H5T_NATIVE_INT H5T_NATIVE_UINT + * H5T_NATIVE_LONG H5T_NATIVE_ULONG + * H5T_NATIVE_LLONG H5T_NATIVE_ULLONG * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, November 16, 1998 * * Modifications: @@ -1665,121 +1659,121 @@ test_derived_integer(void) static int test_conv_int_1(const char *name, hid_t src, hid_t dst) { - size_t nelmts=0; /*num values per test */ - const size_t max_fails=8; /*max number of failures*/ - size_t fails_all_tests=0; /*number of failures */ - size_t fails_this_test; /*fails for this test */ - char str[256]; /*hello string */ - dtype_t src_type, dst_type; /*data types */ - const char *src_type_name=NULL; /*source type name */ - const char *dst_type_name=NULL; /*destination type name */ - int endian; /*machine endianess */ - size_t src_size, dst_size; /*type sizes */ - unsigned char *buf=NULL; /*buffer for conversion */ - unsigned char *saved=NULL; /*original values */ - size_t j, k; /*counters */ - unsigned char *hw=NULL; /*hardware conv result */ - unsigned char src_bits[32]; /*src value in LE order */ - unsigned char dst_bits[32]; /*dest value in LE order*/ - size_t src_nbits; /*source length in bits */ - size_t dst_nbits; /*dst length in bits */ + size_t nelmts=0; /*num values per test */ + const size_t max_fails=8; /*max number of failures*/ + size_t fails_all_tests=0; /*number of failures */ + size_t fails_this_test; /*fails for this test */ + char str[256]; /*hello string */ + dtype_t src_type, dst_type; /*data types */ + const char *src_type_name=NULL; /*source type name */ + const char *dst_type_name=NULL; /*destination type name */ + int endian; /*machine endianess */ + size_t src_size, dst_size; /*type sizes */ + unsigned char *buf=NULL; /*buffer for conversion */ + unsigned char *saved=NULL; /*original values */ + size_t j, k; /*counters */ + unsigned char *hw=NULL; /*hardware conv result */ + unsigned char src_bits[32]; /*src value in LE order */ + unsigned char dst_bits[32]; /*dest value in LE order*/ + size_t src_nbits; /*source length in bits */ + size_t dst_nbits; /*dst length in bits */ H5T_sign_t src_sign; /*source sign type */ H5T_sign_t dst_sign; /*dst sign type */ - void *aligned=NULL; /*aligned temp buffer */ - signed char hw_char; - unsigned char hw_uchar; - short hw_short; - unsigned short hw_ushort; - int hw_int; - unsigned hw_uint; - long hw_long; - unsigned long hw_ulong; - long long hw_llong; - unsigned long long hw_ullong; + void *aligned=NULL; /*aligned temp buffer */ + signed char hw_char; + unsigned char hw_uchar; + short hw_short; + unsigned short hw_ushort; + int hw_int; + unsigned hw_uint; + long hw_long; + unsigned long hw_ulong; + long long hw_llong; + unsigned long long hw_ullong; /* What are the names of the source and destination types */ if (H5Tequal(src, H5T_NATIVE_SCHAR)) { - src_type_name = "signed char"; - src_type = INT_SCHAR; + src_type_name = "signed char"; + src_type = INT_SCHAR; } else if (H5Tequal(src, H5T_NATIVE_UCHAR)) { - src_type_name = "unsigned char"; - src_type = INT_UCHAR; + src_type_name = "unsigned char"; + src_type = INT_UCHAR; } else if (H5Tequal(src, H5T_NATIVE_SHORT)) { - src_type_name = "short"; - src_type = INT_SHORT; + src_type_name = "short"; + src_type = INT_SHORT; } else if (H5Tequal(src, H5T_NATIVE_USHORT)) { - src_type_name = "unsigned short"; - src_type = INT_USHORT; + src_type_name = "unsigned short"; + src_type = INT_USHORT; } else if (H5Tequal(src, H5T_NATIVE_INT)) { - src_type_name = "int"; - src_type = INT_INT; + src_type_name = "int"; + src_type = INT_INT; } else if (H5Tequal(src, H5T_NATIVE_UINT)) { - src_type_name = "unsigned int"; - src_type = INT_UINT; + src_type_name = "unsigned int"; + src_type = INT_UINT; } else if (H5Tequal(src, H5T_NATIVE_LONG)) { - src_type_name = "long"; - src_type = INT_LONG; + src_type_name = "long"; + src_type = INT_LONG; } else if (H5Tequal(src, H5T_NATIVE_ULONG)) { - src_type_name = "unsigned long"; - src_type = INT_ULONG; + src_type_name = "unsigned long"; + src_type = INT_ULONG; } else if (H5Tequal(src, H5T_NATIVE_LLONG)) { - src_type_name = "long long"; - src_type = INT_LLONG; + src_type_name = "long long"; + src_type = INT_LLONG; } else if (H5Tequal(src, H5T_NATIVE_ULLONG)) { - src_type_name = "unsigned long long"; - src_type = INT_ULLONG; + src_type_name = "unsigned long long"; + src_type = INT_ULLONG; } else { - src_type_name = "UNKNOWN"; - src_type = OTHER; + src_type_name = "UNKNOWN"; + src_type = OTHER; } if (H5Tequal(dst, H5T_NATIVE_SCHAR)) { - dst_type_name = "signed char"; - dst_type = INT_SCHAR; + dst_type_name = "signed char"; + dst_type = INT_SCHAR; } else if (H5Tequal(dst, H5T_NATIVE_UCHAR)) { - dst_type_name = "unsigned char"; - dst_type = INT_UCHAR; + dst_type_name = "unsigned char"; + dst_type = INT_UCHAR; } else if (H5Tequal(dst, H5T_NATIVE_SHORT)) { - dst_type_name = "short"; - dst_type = INT_SHORT; + dst_type_name = "short"; + dst_type = INT_SHORT; } else if (H5Tequal(dst, H5T_NATIVE_USHORT)) { - dst_type_name = "unsigned short"; - dst_type = INT_USHORT; + dst_type_name = "unsigned short"; + dst_type = INT_USHORT; } else if (H5Tequal(dst, H5T_NATIVE_INT)) { - dst_type_name = "int"; - dst_type = INT_INT; + dst_type_name = "int"; + dst_type = INT_INT; } else if (H5Tequal(dst, H5T_NATIVE_UINT)) { - dst_type_name = "unsigned int"; - dst_type = INT_UINT; + dst_type_name = "unsigned int"; + dst_type = INT_UINT; } else if (H5Tequal(dst, H5T_NATIVE_LONG)) { - dst_type_name = "long"; - dst_type = INT_LONG; + dst_type_name = "long"; + dst_type = INT_LONG; } else if (H5Tequal(dst, H5T_NATIVE_ULONG)) { - dst_type_name = "unsigned long"; - dst_type = INT_ULONG; + dst_type_name = "unsigned long"; + dst_type = INT_ULONG; } else if (H5Tequal(dst, H5T_NATIVE_LLONG)) { - dst_type_name = "long long"; - dst_type = INT_LLONG; + dst_type_name = "long long"; + dst_type = INT_LLONG; } else if (H5Tequal(dst, H5T_NATIVE_ULLONG)) { - dst_type_name = "unsigned long long"; - dst_type = INT_ULLONG; + dst_type_name = "unsigned long long"; + dst_type = INT_ULLONG; } else { - dst_type_name = "UNKNOWN"; - dst_type = OTHER; + dst_type_name = "UNKNOWN"; + dst_type = OTHER; } /* Sanity checks */ if (OTHER==src_type || OTHER==dst_type) { - HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", - name, src_type_name, dst_type_name); - printf("%-70s", str); - H5_FAILED(); - HDputs(" Unknown data type."); - goto error; + HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", + name, src_type_name, dst_type_name); + HDprintf("%-70s", str); + H5_FAILED(); + HDputs(" Unknown data type."); + goto error; } else { HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, src_type_name, dst_type_name); - printf("%-70s", str); + HDprintf("%-70s", str); HDfflush(stdout); fails_this_test=0; } @@ -2462,44 +2456,44 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) /* Print errors */ if (0==fails_this_test++) H5_FAILED(); - printf(" elmt %u\n", (unsigned)j); + HDprintf(" elmt %u\n", (unsigned)j); - printf(" src = "); + HDprintf(" src = "); for (k=0; k0) { - while (child_pid!=waitpid(child_pid, &status, 0)) /*void*/; - if (WIFEXITED(status) && 255==WEXITSTATUS(status)) { - return 0; /*child exit after catching SIGFPE*/ - } else if (WIFEXITED(status)) { - return WEXITSTATUS(status); - } else if (WIFSIGNALED(status)) { - HDsnprintf(str, sizeof(str), " Child caught signal %d.", WTERMSIG(status)); - HDputs(str); - return 1; /*child exit after catching non-SIGFPE signal */ - } else { - HDputs(" Child didn't exit normally."); - return 1; - } + while (child_pid!=waitpid(child_pid, &status, 0)) /*void*/; + if (WIFEXITED(status) && 255==WEXITSTATUS(status)) { + return 0; /*child exit after catching SIGFPE*/ + } else if (WIFEXITED(status)) { + return WEXITSTATUS(status); + } else if (WIFSIGNALED(status)) { + HDsnprintf(str, sizeof(str), " Child caught signal %d.", WTERMSIG(status)); + HDputs(str); + return 1; /*child exit after catching non-SIGFPE signal */ + } else { + HDputs(" Child didn't exit normally."); + return 1; + } } #endif @@ -2916,35 +2910,35 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) /* What are the names of the source and destination types */ if (H5Tequal(src, H5T_NATIVE_FLOAT)) { - src_type_name = "float"; - src_type = FLT_FLOAT; + src_type_name = "float"; + src_type = FLT_FLOAT; } else if (H5Tequal(src, H5T_NATIVE_DOUBLE)) { - src_type_name = "double"; - src_type = FLT_DOUBLE; + src_type_name = "double"; + src_type = FLT_DOUBLE; #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 } else if (H5Tequal(src, H5T_NATIVE_LDOUBLE)) { - src_type_name = "long double"; - src_type = FLT_LDOUBLE; + src_type_name = "long double"; + src_type = FLT_LDOUBLE; #endif } else { - src_type_name = "UNKNOWN"; - src_type = OTHER; + src_type_name = "UNKNOWN"; + src_type = OTHER; } if (H5Tequal(dst, H5T_NATIVE_FLOAT)) { - dst_type_name = "float"; - dst_type = FLT_FLOAT; + dst_type_name = "float"; + dst_type = FLT_FLOAT; } else if (H5Tequal(dst, H5T_NATIVE_DOUBLE)) { - dst_type_name = "double"; - dst_type = FLT_DOUBLE; + dst_type_name = "double"; + dst_type = FLT_DOUBLE; #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 } else if (H5Tequal(dst, H5T_NATIVE_LDOUBLE)) { - dst_type_name = "long double"; - dst_type = FLT_LDOUBLE; + dst_type_name = "long double"; + dst_type = FLT_LDOUBLE; #endif } else { - dst_type_name = "UNKNOWN"; - dst_type = OTHER; + dst_type_name = "UNKNOWN"; + dst_type = OTHER; } /* Sanity checks */ @@ -2952,22 +2946,22 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) HDputs("Sizeof(float)==sizeof(double) - some tests may not be sensible."); if (OTHER==src_type || OTHER==dst_type) { if(!strcmp(name, "noop")) - HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", - name, src_type_name, dst_type_name); + HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", + name, src_type_name, dst_type_name); else if(run_test==TEST_SPECIAL) - HDsnprintf(str, sizeof(str), "Testing %s special %s -> %s conversions", - name, src_type_name, dst_type_name); + HDsnprintf(str, sizeof(str), "Testing %s special %s -> %s conversions", + name, src_type_name, dst_type_name); else if(run_test==TEST_NORMAL) - HDsnprintf(str, sizeof(str), "Testing %s normalized %s -> %s conversions", - name, src_type_name, dst_type_name); + HDsnprintf(str, sizeof(str), "Testing %s normalized %s -> %s conversions", + name, src_type_name, dst_type_name); else if(run_test==TEST_DENORM) - HDsnprintf(str, sizeof(str), "Testing %s denormalized %s -> %s conversions", - name, src_type_name, dst_type_name); + HDsnprintf(str, sizeof(str), "Testing %s denormalized %s -> %s conversions", + name, src_type_name, dst_type_name); - printf("%-70s", str); - H5_FAILED(); - HDputs(" Unknown data type."); - goto error; + HDprintf("%-70s", str); + H5_FAILED(); + HDputs(" Unknown data type."); + goto error; } else { if(!strcmp(name, "noop")) HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", @@ -2982,7 +2976,7 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) HDsnprintf(str, sizeof(str), "Testing %s denormalized %s -> %s conversions", name, src_type_name, dst_type_name); - printf("%-70s", str); + HDprintf("%-70s", str); HDfflush(stdout); fails_this_test = 0; } @@ -3199,18 +3193,18 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) * the SGI compiler assigns the dst's maximal value. */ { - double check_mant[2]; - int check_expo[2]; + double check_mant[2]; + int check_expo[2]; if (FLT_FLOAT==dst_type) { float x; HDmemcpy(&x, &buf[j*dst_size], sizeof(float)); if (underflow && HDfabsf(x) <= FLT_MIN && HDfabsf(hw_f) <= FLT_MIN) - continue; /* all underflowed, no error */ + continue; /* all underflowed, no error */ if (overflow && my_isinf(dendian, buf+j*sizeof(float), dst_size, dst_mpos, dst_msize, dst_epos, dst_esize)) - continue; /* all overflowed, no error */ + continue; /* all overflowed, no error */ check_mant[0] = HDfrexpf(x, check_expo+0); check_mant[1] = HDfrexpf(hw_f, check_expo+1); } else if (FLT_DOUBLE==dst_type) { @@ -3218,10 +3212,10 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) HDmemcpy(&x, &buf[j*dst_size], sizeof(double)); if (underflow && HDfabs(x) <= DBL_MIN && HDfabs(hw_d) <= DBL_MIN) - continue; /* all underflowed, no error */ + continue; /* all underflowed, no error */ if (overflow && my_isinf(dendian, buf+j*sizeof(double), dst_size, dst_mpos, dst_msize, dst_epos, dst_esize)) - continue; /* all overflowed, no error */ + continue; /* all overflowed, no error */ check_mant[0] = HDfrexp(x, check_expo+0); check_mant[1] = HDfrexp(hw_d, check_expo+1); #if H5_SIZEOF_LONG_DOUBLE !=0 && (H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE) @@ -3264,20 +3258,20 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) H5_WARNING(); } } - printf(" elmt %u\n", (unsigned)j); + HDprintf(" elmt %u\n", (unsigned)j); - printf(" src ="); + HDprintf(" src ="); for (k=0; k %s conversions", - name, src_type_name, dst_type_name); - printf("%-70s", str); - H5_FAILED(); - HDputs(" Unknown data type."); - goto error; + HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", + name, src_type_name, dst_type_name); + HDprintf("%-70s", str); + H5_FAILED(); + HDputs(" Unknown data type."); + goto error; } if ((INT_SCHAR==src_type || INT_UCHAR==src_type || INT_SHORT==src_type || @@ -3566,12 +3560,12 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) && FLT_LDOUBLE!=dst_type #endif )) { - HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", - name, src_type_name, dst_type_name); - printf("%-70s", str); - H5_FAILED(); - HDputs(" 1. Not an integer-float conversion."); - goto error; + HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", + name, src_type_name, dst_type_name); + HDprintf("%-70s", str); + H5_FAILED(); + HDputs(" 1. Not an integer-float conversion."); + goto error; } if ((FLT_FLOAT==src_type || FLT_DOUBLE==src_type @@ -3583,12 +3577,12 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) && INT_USHORT!=dst_type && INT_INT!=dst_type && INT_UINT!=dst_type && INT_LONG!=dst_type && INT_ULONG!=dst_type && INT_LLONG!=dst_type && INT_ULLONG!=dst_type)) { - HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", - name, src_type_name, dst_type_name); - printf("%-70s", str); - H5_FAILED(); - HDputs(" 2. Not a float-integer conversion."); - goto error; + HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", + name, src_type_name, dst_type_name); + HDprintf("%-70s", str); + H5_FAILED(); + HDputs(" 2. Not a float-integer conversion."); + goto error; } if (INT_SCHAR==src_type || INT_UCHAR==src_type || INT_SHORT==src_type || @@ -3597,7 +3591,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) INT_ULLONG==src_type) { HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, src_type_name, dst_type_name); - printf("%-70s", str); + HDprintf("%-70s", str); HDfflush(stdout); fails_this_test=0; } else { @@ -3610,7 +3604,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) else HDsnprintf(str, sizeof(str), "Testing %s special %s -> %s conversions", name, src_type_name, dst_type_name); - printf("%-70s", str); + HDprintf("%-70s", str); HDfflush(stdout); fails_this_test=0; } @@ -4347,44 +4341,44 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) H5_WARNING(); } } - printf(" elmt %u: \n", (unsigned)j); + HDprintf(" elmt %u: \n", (unsigned)j); - printf(" src = "); + HDprintf(" src = "); for (k=0; k %s conversions", name, "long double", "float"); - printf("%-70s", str); + HDprintf("%-70s", str); SKIPPED(); #if H5_SIZEOF_LONG_DOUBLE!=0 HDputs(" Test skipped due to the conversion problem on IBM ppc64le cpu."); @@ -4915,11 +4909,11 @@ run_fp_tests(const char *name) nerrors += test_conv_flt_1(name, TEST_SPECIAL, H5T_NATIVE_LDOUBLE, H5T_NATIVE_DOUBLE); #else { - char str[256]; /*string */ + char str[256]; /*string */ HDsnprintf(str, sizeof(str), "Testing %s special %s -> %s conversions", name, "long double", "float or double"); - printf("%-70s", str); + HDprintf("%-70s", str); SKIPPED(); #if H5_SIZEOF_LONG_DOUBLE!=0 HDputs(" Test skipped due to the conversion problem on IBM ppc64le cpu."); @@ -4934,15 +4928,15 @@ done: return nerrors; } - + /*------------------------------------------------------------------------- - * Function: run_int_fp_conv + * Function: run_int_fp_conv * - * Purpose: Runs all integer-float tests. + * Purpose: Runs all integer-float tests. * - * Return: Number of errors + * Return: Number of errors * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Monday, November 10, 2003 * * Modifications: @@ -4952,7 +4946,7 @@ done: static int run_int_fp_conv(const char *name) { - int nerrors = 0; + int nerrors = 0; nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_SCHAR, H5T_NATIVE_FLOAT); nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_SCHAR, H5T_NATIVE_DOUBLE); @@ -5001,11 +4995,11 @@ run_int_fp_conv(const char *name) nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_ULONG, H5T_NATIVE_LDOUBLE); #else { - char str[256]; /*string */ + char str[256]; /*string */ HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "(unsigned) long", "long double"); - printf("%-70s", str); + HDprintf("%-70s", str); SKIPPED(); #if H5_SIZEOF_LONG_DOUBLE!=0 HDputs(" Test skipped due to the special algorithm of hardware conversion."); @@ -5020,11 +5014,11 @@ run_int_fp_conv(const char *name) nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_LLONG, H5T_NATIVE_LDOUBLE); #else /* H5_LLONG_TO_LDOUBLE_CORRECT */ { - char str[256]; /*hello string */ + char str[256]; /*hello string */ HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "long long", "long double"); - printf("%-70s", str); + HDprintf("%-70s", str); SKIPPED(); HDputs(" Test skipped due to compiler error in handling conversion."); } @@ -5033,11 +5027,11 @@ run_int_fp_conv(const char *name) nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_ULLONG, H5T_NATIVE_LDOUBLE); #else /* H5_LLONG_TO_LDOUBLE_CORRECT */ { - char str[256]; /*hello string */ + char str[256]; /*hello string */ HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "unsigned long long", "long double"); - printf("%-70s", str); + HDprintf("%-70s", str); SKIPPED(); HDputs(" Test skipped due to compiler not handling conversion."); } @@ -5048,15 +5042,15 @@ run_int_fp_conv(const char *name) return nerrors; } - + /*------------------------------------------------------------------------- - * Function: run_fp_int_conv + * Function: run_fp_int_conv * - * Purpose: Runs all float-integer tests. + * Purpose: Runs all float-integer tests. * - * Return: Number of errors + * Return: Number of errors * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Monday, November 10, 2003 * * Modifications: @@ -5066,7 +5060,7 @@ run_int_fp_conv(const char *name) static int run_fp_int_conv(const char *name) { - int nerrors = 0; + int nerrors = 0; int test_values; for(test_values = TEST_NORMAL; test_values <= TEST_SPECIAL; test_values++) { @@ -5111,7 +5105,7 @@ run_fp_int_conv(const char *name) #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE if(test_values != TEST_SPECIAL) { - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_SCHAR); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_SCHAR); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_UCHAR); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_SHORT); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_USHORT); @@ -5119,18 +5113,18 @@ run_fp_int_conv(const char *name) nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_UINT); } else { #ifndef H5_DISABLE_SOME_LDOUBLE_CONV - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_SCHAR); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_SCHAR); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_UCHAR); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_SHORT); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_USHORT); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_INT); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_UINT); #else - char str[256]; /*string */ + char str[256]; /*string */ HDsnprintf(str, sizeof(str), "Testing %s special %s -> %s conversions", name, "long double", "signed and unsigned char, short, int, long"); - printf("%-70s", str); + HDprintf("%-70s", str); SKIPPED(); #if H5_SIZEOF_LONG_DOUBLE!=0 HDputs(" Test skipped due to the conversion problem on IBM ppc64le cpu."); @@ -5152,11 +5146,11 @@ run_fp_int_conv(const char *name) } #else { - char str[256]; /*string */ + char str[256]; /*string */ HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "long double", "(unsigned) long"); - printf("%-70s", str); + HDprintf("%-70s", str); SKIPPED(); #if H5_SIZEOF_LONG_DOUBLE!=0 HDputs(" Test skipped due to the special algorithm of hardware conversion."); @@ -5172,11 +5166,11 @@ run_fp_int_conv(const char *name) nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_LLONG); #else /*H5_LDOUBLE_TO_LLONG_ACCURATE*/ { - char str[256]; /*string */ + char str[256]; /*string */ HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "long double", "long long"); - printf("%-70s", str); + HDprintf("%-70s", str); SKIPPED(); #if H5_SIZEOF_LONG_DOUBLE!=0 HDputs(" Test skipped due to hardware conversion error."); @@ -5189,11 +5183,11 @@ run_fp_int_conv(const char *name) nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_ULLONG); #else /*H5_LDOUBLE_TO_LLONG_ACCURATE*/ { - char str[256]; /*string */ + char str[256]; /*string */ HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "long double", "unsigned long long"); - printf("%-70s", str); + HDprintf("%-70s", str); SKIPPED(); #if H5_SIZEOF_LONG_DOUBLE!=0 HDputs(" Test skipped due to hardware conversion error."); @@ -5209,7 +5203,7 @@ run_fp_int_conv(const char *name) return nerrors; } - + /*------------------------------------------------------------------------- * Function: main * @@ -5233,7 +5227,7 @@ run_fp_int_conv(const char *name) int main(void) { - unsigned long nerrors = 0; + unsigned long nerrors = 0; /* Set the random # seed */ HDsrandom((unsigned)HDtime(NULL)); @@ -5241,7 +5235,7 @@ main(void) reset_hdf5(); if (ALIGNMENT) - printf("Testing non-aligned conversions (ALIGNMENT=%d)....\n", ALIGNMENT); + HDprintf("Testing non-aligned conversions (ALIGNMENT=%d)....\n", ALIGNMENT); /* Do the tests */ @@ -5310,11 +5304,11 @@ main(void) h5_restore_err(); if (nerrors) { - printf("***** %lu FAILURE%s! *****\n", + HDprintf("***** %lu FAILURE%s! *****\n", nerrors, 1==nerrors?"":"S"); HDexit(EXIT_FAILURE); } - printf("All data type tests passed.\n"); + HDprintf("All data type tests passed.\n"); return 0; } diff --git a/test/earray.c b/test/earray.c index bb258c7..57df4d5 100644 --- a/test/earray.c +++ b/test/earray.c @@ -530,10 +530,10 @@ verify_cparam(const H5EA_t *ea, const H5EA_create_t *cparam) TEST_ERROR /* Success */ - return 0; + return SUCCEED; error: - return -1; + return FAIL; } /* verify_cparam() */ diff --git a/test/th5o.c b/test/th5o.c index 0aa589f..099bb92 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -378,7 +378,7 @@ test_h5o_refcount(void) { hid_t fid; /* HDF5 File ID */ hid_t grp, dset, dtype, dspace; /* Object identifiers */ - H5O_info_t oinfo; /* Object info struct */ + H5O_info_t oinfo; /* Object info struct */ hsize_t dims[RANK]; herr_t ret; /* Value returned from API calls */ @@ -850,7 +850,7 @@ test_h5o_link(void) /* Verify the data */ for(i = 0; i < (TEST6_DIM1 * TEST6_DIM2); i++) VERIFY(wdata[i], rdata[i], "H5Dread"); - + /* Create a group with no name*/ group_id = H5Gcreate_anon(file_id, H5P_DEFAULT, H5P_DEFAULT); CHECK(group_id, FAIL, "H5Gcreate_anon"); @@ -1254,7 +1254,7 @@ test_h5o_getinfo_same_file(void) { hid_t fid1, fid2; /* HDF5 File ID */ hid_t gid1, gid2; /* Group IDs */ - H5O_info_t oinfo1, oinfo2; /* Object info structs */ + H5O_info_t oinfo1, oinfo2; /* Object info structs */ herr_t ret; /* Value returned from API calls */ /* Create a new HDF5 file */ @@ -1491,29 +1491,29 @@ test_h5o(void) /* Output message about test being performed */ MESSAGE(5, ("Testing Objects\n")); - test_h5o_open(); /* Test generic open function */ - test_h5o_open_by_addr(); /* Test opening objects by address */ - test_h5o_close(); /* Test generic close function */ - test_h5o_refcount(); /* Test incrementing and decrementing reference count */ - test_h5o_plist(); /* Test object creation properties */ - test_h5o_link(); /* Test object link routine */ - test_h5o_comment(); /* Test routines for comment */ - test_h5o_comment_by_name(); /* Test routines for comment by name */ + test_h5o_open(); /* Test generic open function */ + test_h5o_open_by_addr(); /* Test opening objects by address */ + test_h5o_close(); /* Test generic close function */ + test_h5o_refcount(); /* Test incrementing and decrementing reference count */ + test_h5o_plist(); /* Test object creation properties */ + test_h5o_link(); /* Test object link routine */ + test_h5o_comment(); /* Test routines for comment */ + test_h5o_comment_by_name(); /* Test routines for comment by name */ test_h5o_getinfo_same_file(); /* Test info for objects in the same file */ #ifndef H5_NO_DEPRECATED_SYMBOLS - test_h5o_getinfo_visit(); /* Test object info for H5Oget_info1/2 and H5Ovisit1 */ + test_h5o_getinfo_visit(); /* Test object info for H5Oget_info1/2 and H5Ovisit1 */ #endif } /* test_h5o() */ /*------------------------------------------------------------------------- - * Function: cleanup_h5o + * Function: cleanup_h5o * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: James Laird + * Programmer: James Laird * June 3, 2006 * *------------------------------------------------------------------------- diff --git a/test/titerate.c b/test/titerate.c index 716654d..7bc3bf7 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -946,7 +946,7 @@ find_err_msg_cb(unsigned H5_ATTR_UNUSED n, const H5E_error2_t *err_desc, void *_ if (searched_err == NULL) 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) { -- cgit v0.12